create a dynamic form element on radios click
haii, i am a newbie to drupal 6 i want a help from all of you. I have created a module in which i have a form created using form elements. Now i want is that as i click on one of the radio button i need to generate a form element in my block.pieces of codefunction test_form(){$form['flight'] = array( '#type' => 'tabset', );$form['flight']['tab1'] = array('#type' => 'tabpage','#title' => t('Domestic'), );$form['options']=array('#type' => 'value','#value' =>array('one'=>t('One Way'),'two'=>t('Round Trip')),);$form['flight']['tab1']['title1'] = array('#type' => 'radios','#options' => $form['options']['#value'],'#multiple' => FALSE,'#prefix' => '<td><div class="container-inline">','#suffix' => '</div></td>',);....more codes are therereturn $form;}what i want is on clicking the oneway radio i need the below form element to come up automaticallyyy$form['flight']['tab1']['title4'] = array('#type' => 'select','#title' => t('Preferred Class'),'#options' => array('Y'=>t('Economy'),'C'=>t('Business')),'#prefix' => '<tr><td>','#suffix' => '</td></tr>',);thanks in advacnce for your help...please do reply to thisssssss
- seema's blog
- Login or register to post comments













Bookmark this site
Bookmark this page
Make us your homepage





Recent comments
2 years 24 weeks ago
2 years 26 weeks ago
2 years 29 weeks ago
2 years 29 weeks ago
2 years 29 weeks ago
2 years 29 weeks ago