function ajax_forms_test_simple_form
A basic form used to test form_state['values'] during callback.
1 string reference to 'ajax_forms_test_simple_form'
- ajax_forms_test_menu in modules/
simpletest/ tests/ ajax_forms_test.module - Implements hook_menu().
File
-
modules/
simpletest/ tests/ ajax_forms_test.module, line 44
Code
function ajax_forms_test_simple_form($form, &$form_state) {
$form = array();
$form['select'] = array(
'#type' => 'select',
'#options' => array(
'red' => 'red',
'green' => 'green',
'blue' => 'blue',
),
'#ajax' => array(
'callback' => 'ajax_forms_test_simple_form_select_callback',
),
'#suffix' => '<div id="ajax_selected_color">No color yet selected</div>',
);
$form['checkbox'] = array(
'#type' => 'checkbox',
'#title' => t('Test checkbox'),
'#ajax' => array(
'callback' => 'ajax_forms_test_simple_form_checkbox_callback',
),
'#suffix' => '<div id="ajax_checkbox_value">No action yet</div>',
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('submit'),
);
return $form;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.