I need to toggle a textbox depending upon the checkbox value.
Basically i need to take email entries for updates.
Here is the form elements I used.
$form['chkupdates'] = array(
'#type' => 'checkbox',
'#title' => t('Sign up to receive email updates about Green Apple'),
'#options' => array(
'1' => t('Yes'),
'0' => t('No')
),
'#default_value' => FALSE,
'#attributes' => Array('class'=>'sub-form-element',
'id'=>'chkbox'),
);
$form['chkmail'] = array(
'#type' => 'textfield',
'#title' => t(''),
'#attributes' => Array('class'=>'field','id'=>'chktext'),
);
Please guide.I am rendering elements in tpl files so jQuery is acceptable. Thanks