1 ajax_example_graceful_degradation.inc ajax_example_dynamic_sections_validate($form, &$form_state)

Validation function for ajax_example_dynamic_sections().

Related topics

File

modules/examples/ajax_example/ajax_example_graceful_degradation.inc, line 286
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".)'));
  }
}