tags:

views:

18

answers:

1

I want to create a form element that gonna output like this

select date: [day] [month] [year]

and each [box] is select box ...

how can I do it with Drupal Form api I wouldn't want to use any fancy plugins / addons.

$form['dob'] = array( '#type' => 'select', '#title' => t('select date:'), '#options' => array(1,2,3), );

outputs only

select date: [day]
A: 
  • You can create 3 form items, and using theming to get the desired result.
  • You can create your own form item which create 3 select boxes and a label with hook_elements. This is somewhat time consuming.
googletorp