Submit handler for the "remove one" button.
Decrements the max counter and causes a form rebuild.
Related topics
1 string reference to 'ajax_example_add_more_remove_one'
- ajax_example_add_more in ajax_example/
ajax_example_graceful_degradation.inc - Form with 'add more' and 'remove' buttons.
File
- ajax_example/
ajax_example_graceful_degradation.inc, line 646 - 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;
}