function form_example_tutorial_8_page_two

Returns the form for the second page of form_example_tutorial_8().

Related topics

1 call to form_example_tutorial_8_page_two()
form_example_tutorial_8 in form_example/form_example_tutorial.inc
Example 8: A simple multistep form with a Next and a Back button.

File

form_example/form_example_tutorial.inc, line 434

Code

function form_example_tutorial_8_page_two($form, &$form_state) {
    $form['description'] = array(
        '#type' => 'item',
        '#title' => t('A basic multistep form (page 2)'),
    );
    $form['color'] = array(
        '#type' => 'textfield',
        '#title' => t('Favorite color'),
        '#required' => TRUE,
        '#default_value' => !empty($form_state['values']['color']) ? $form_state['values']['color'] : '',
    );
    $form['submit'] = array(
        '#type' => 'submit',
        '#value' => t('Submit'),
        '#submit' => array(
            'form_example_tutorial_8_page_two_submit',
        ),
    );
    $form['back'] = array(
        '#type' => 'submit',
        '#value' => t('<< Back'),
        '#submit' => array(
            'form_example_tutorial_8_page_two_back',
        ),
        // We won't bother validating the required 'color' field, since they
        // have to come back to this page to submit anyway.
'#limit_validation_errors' => array(),
    );
    return $form;
}