create a dynamic form element on radios click

seema's picture

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


No votes yet

Proud Member and Supporter of the Drupal Association

User login

Syndicate

Syndicate content

Feed It!

  • FeedBurner FeedCount for IMCrunch.com - Internet Marketing Authority Site
  • Add to Google Reader or Homepage
  • Add IMCrunch.com to Newsburst
  • Subscribe in Bloglines
  • Add to netvibes
  • Add to Pageflakes
  • Subscribe in Bloglines