Submit handler for form_example_tutorial_8() next button.

Capture the values from page one and store them away so they can be used at final submit time.

Related topics

1 string reference to 'form_example_tutorial_8_next_submit'
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 483
This is the Form API Tutorial from the handbook.

Code

function form_example_tutorial_8_next_submit($form, &$form_state) {

  // Values are saved for each page.
  // to carry forward to subsequent pages in the form.
  // and we tell FAPI to rebuild the form.
  $form_state['page_values'][1] = $form_state['values'];
  if (!empty($form_state['page_values'][2])) {
    $form_state['values'] = $form_state['page_values'][2];
  }

  // When form rebuilds, it will look at this to figure which page to build.
  $form_state['page_num'] = 2;
  $form_state['rebuild'] = TRUE;
}