function content_add_more_submit in Content Construction Kit (CCK) 6.2
Same name and namespace in other branches
- 6.3 includes/content.node_form.inc \content_add_more_submit()
- 6 includes/content.node_form.inc \content_add_more_submit()
Submit handler to add more choices to a content form. This handler is used when JavaScript is not available. It makes changes to the form state and the entire form is rebuilt during the page reload.
1 call to content_add_more_submit()
- content_add_more_submit_proxy in ./
content.module - Proxy function to call content_add_more_submit(), because it might not be included yet when the form is processed and invokes the callback.
File
- includes/
content.node_form.inc, line 255 - Create fields' form for a content type.
Code
function content_add_more_submit($form, &$form_state) {
// Set the form to rebuild and run submit handlers.
node_form_submit_build_node($form, $form_state);
$field_name = $form_state['clicked_button']['#field_name'];
$type_name = $form_state['clicked_button']['#type_name'];
// Make the changes we want to the form state.
if ($form_state['values'][$field_name][$field_name . '_add_more']) {
$form_state['item_count'][$field_name] = count($form_state['values'][$field_name]);
}
}