function form_test_programmatic_form_validate
7.x form_test.module | form_test_programmatic_form_validate($form, &$form_state) |
Form validation handler for programmatic form submissions.
To test that the validation handler is correctly executed, the field value is explicitly required here.
File
- drupal-7.x/
modules/ simpletest/ tests/ form_test.module, line 1602 - Helper module for the form API tests.
Code
function form_test_programmatic_form_validate($form, &$form_state) {
if (empty($form_state['values']['textfield'])) {
form_set_error('textfield', t('Textfield is required.'));
}
}