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

Returns form elements for the 'location info' page of the wizard.

This is the second step of the wizard. This step asks for a textfield value: a City. This step also includes a validation declared later.

Related topics

File

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

Code

function form_example_wizard_location_info($form, &$form_state) {
  $form = array();
  $form['city'] = array(
    '#type' => 'textfield',
    '#title' => t('City'),
    '#description' => t('Hint: Do not enter "San Francisco", and do not leave this out.'),
    '#required' => TRUE,
    '#default_value' => !empty($form_state['values']['city']) ? $form_state['values']['city'] : '',

  );
  return $form;
}