You are here

function batch_example_multistep_form in Examples for Developers 6

Multistep form

Related topics

1 string reference to 'batch_example_multistep_form'
batch_example_menu in batch_example/batch_example.module
Implementation of hook_menu().

File

batch_example/batch_example.module, line 120
This is an example outlining how a module can define batches.

Code

function batch_example_multistep_form($form_state = NULL) {
  $step = isset($form_state['storage']['step']) ? $form_state['storage']['step'] : 1;
  $form['step_display'] = array(
    '#type' => 'item',
    '#value' => 'step ' . $step,
  );
  if ($step < 3) {
    $form['submit'] = array(
      '#type' => 'submit',
      '#value' => 'Go',
    );
  }
  return $form;
}