batch_example_multistep_form

6 batch_example.module batch_example_multistep_form($form_state = NULL)

Multistep form

Related topics

1 string reference to 'batch_example_multistep_form'

File

batch_example/batch_example.module, line 105
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;
}
Login or register to post comments