Hi there,
sorry but i have 3 questions:
1- How can i trigger ajax on a specifix choice of radio button in a radios list?
Adding the ajax attribute to the form element triggers the ajax function on every value change!
$form['act_type'] = array(
'#type' => 'radios',
'#title' => t('Type'),
'#options' => drupal_map_assoc(array(
t('Art'),
t('Conference'),
t('Music'),
t('Other'),
)),
'#default_value' => empty($form_state['values']['act_type']) ? '' : $form_state['values']['act_type'],
'#required' => TRUE,
'#ajax' => array(
'wrapper' => 'act-type-other-div',
'callback' => 'show_act_type_other_callback',
'effect' => 'fade',
)
);
I just want ajax to be triggered when the "Other" radio is chosen.
2- The same question concerning checkboxes.
$form['act_type'] = array(
'#type' => 'checkboxes',
'#title' => t('Type'),
'#options' => drupal_map_assoc(array(
t('Art'),
t('Conference'),
t('Music'),
t('Other'),
)),
'#default_value' => empty($form_state['values']['act_type']) ? '' : $form_state['values']['act_type'],
'#required' => TRUE,
'#ajax' => array(
'wrapper' => 'act-type-other-div',
'callback' => 'show_act_type_other_callback',
'effect' => 'fade',
)
);