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 656
This is the Form API Tutorial, originally from the Backdrop handbook.

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;
}