batch_example_multistep_form_submit

Definition

batch_example_multistep_form_submit($form, &$form_state)
developer/examples/batch_example.module, line 116

Code

<?php
function batch_example_multistep_form_submit($form, &$form_state) {
  $step = isset($form_state['storage']['step']) ? $form_state['storage']['step'] : 1;

  switch ($step) {
    case 1:
      drupal_set_message('step 1 submitted');
      batch_set(batch_example_batch_1());
      break;
    case 2:
      drupal_set_message('step 2 submitted');
      batch_set(batch_example_batch_2());
      // this does not seem to work ?
      $form_state['redirect'] = 'batch_example/example_3';
      break;
  }

  $form_state['storage']['step'] = $step + 1;
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.