function ajax_example_dynamic_sections_validate in Examples for Developers 7
Validation function for ajax_example_dynamic_sections().
Related topics
File
- ajax_example/
ajax_example_graceful_degradation.inc, line 287 - Demonstrations of AJAX with graceful degradation.
Code
function ajax_example_dynamic_sections_validate($form, &$form_state) {
$answer = $form_state['values']['question'];
if ($answer !== t('George Washington')) {
form_set_error('question', t('Wrong answer. Try again. (Hint: The right answer is "George Washington".)'));
}
}