1 ajax_example_graceful_degradation.inc ajax_example_add_more_remove_one($form, &$form_state)

Submit handler for the "remove one" button.

Decrements the max counter and causes a form rebuild.

Related topics

File

modules/examples/ajax_example/ajax_example_graceful_degradation.inc, line 640
Demonstrations of AJAX with graceful degradation.

Code

function ajax_example_add_more_remove_one($form, &$form_state) {
  if ($form_state['num_names'] > 1) {
    $form_state['num_names']--;
  }
  $form_state['rebuild'] = TRUE;
}