1 form_example_tutorial.inc | form_example_tutorial_8_next_submit($form, &$form_state) |
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.
File
- modules/
examples/ form_example/ form_example_tutorial.inc, line 446 - This is the form API tutorial.
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;
}