function form_example_wizard_next_submit

Submit handler for the 'next' button.

This function:

  • Saves away $form_state['values']
  • Increments the step count.
  • Replace $form_state['values'] from the last time we were at this page or with array() if we haven't been here before.
  • Force form rebuild.

You are not required to change this function.

Related topics

1 string reference to 'form_example_wizard_next_submit'
form_example_wizard in form_example/form_example_wizard.inc
The primary formbuilder function for the wizard form.

File

form_example/form_example_wizard.inc, line 180

Code

function form_example_wizard_next_submit($form, &$form_state) {
    $current_step =& $form_state['step'];
    $form_state['step_information'][$current_step]['stored_values'] = $form_state['values'];
    if ($current_step < count($form_state['step_information'])) {
        $current_step++;
        if (!empty($form_state['step_information'][$current_step]['stored_values'])) {
            $form_state['values'] = $form_state['step_information'][$current_step]['stored_values'];
        }
        else {
            $form_state['values'] = array();
        }
        // Force rebuild with next step.
        $form_state['rebuild'] = TRUE;
        return;
    }
}