1 form_test.module | form_test_redirect($form, &$form_state) |
Form builder to detect form redirect.
File
- core/
modules/ simpletest/ tests/ form_test.module, line 2457 - Helper module for the Form API tests.
Code
function form_test_redirect($form, &$form_state) {
$form['redirection'] = array(
'#type' => 'checkbox',
'#title' => t('Use redirection'),
);
$form['destination'] = array(
'#type' => 'textfield',
'#title' => t('Redirect destination'),
'#states' => array(
'visible' => array(
':input[name="redirection"]' => array('checked' => TRUE),
),
),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
);
return $form;
}