| 7 form_example_tutorial.inc | form_example_tutorial_8_next_submit($form, &$form_state) |
| 8 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.
1 string reference to 'form_example_tutorial_8_next_submit'
File
- form_example/
form_example_tutorial.inc, line 485 - 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;
}
Login or register to post comments