function content_add_more_submit in Content Construction Kit (CCK) 6
Same name and namespace in other branches
- 6.3 includes/content.node_form.inc \content_add_more_submit()
- 6.2 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 string reference to 'content_add_more_submit'
- content_multiple_value_form in includes/
content.node_form.inc - Special handling to create form elements for multiple values.
File
- includes/
content.node_form.inc, line 223
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'];
foreach ($form['#field_info'] as $field_name => $field) {
// 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['node'][$field_name]) + 1;
}
}
}