Above is the sample screenshot of my form where I would like to do is:
When I click/check on radio button "One" then its value should display in textfield of "Display".
Code:
function test_radio_menu() {
$items['test_radio'] = array(
'title' => 'test_radio',
'page callback' => 'drupal_get_form',
'page arguments' => array('test_radio_form'),
'access arguments' => array('access content'),
'access callback' => TRUE,
);
return $items;
}
/**
* Implements hook_form().
*/
function test_radio_form($form, &$form_submit){
/* the options to display in our form radio buttons */
$options = array(
'one' => t('One'),
'two' => t('Two'),
);
$form['count'] = array(
'#title' => t('Count'),
'#type' => 'radios',
'#options' => $options,
);
$form['display'] = array(
'#title' => t('Display'),
'#type' => 'textfield',
'#value' => ,
);
$form['submit'] = array(
'#value' => t('PROCEED'),
'#type' => 'submit',
);
return $form;
}