1 form_example_wizard.inc form_example_wizard_location_info_validate($form, &$form_state)

Custom validation form for the 'location info' page of the wizard.

This is the validation function for the second step of the wizard. The city cannot be empty or be "San Francisco".

Related topics

File

modules/examples/form_example/form_example_wizard.inc, line 262
Extensible wizard form example.

Code

function form_example_wizard_location_info_validate($form, &$form_state) {
  if ($form_state['values']['city'] == 'San Francisco') {
    form_set_error('city', t('You were warned not to enter "San Francisco"'));
  }
}