1 form_example_tutorial.inc form_example_tutorial_9_remove_name($form, &$form_state)

Submit handler for "Remove name" button on form_example_tutorial_9().

File

modules/examples/form_example/form_example_tutorial.inc, line 635
This is the form API tutorial.

Code

function form_example_tutorial_9_remove_name($form, &$form_state) {
  if ($form_state['num_names'] > 1) {
    $form_state['num_names']--;
  }

  // Setting $form_state['rebuild'] = TRUE causes the form to be rebuilt again.
  $form_state['rebuild'] = TRUE;
}