function recipe_more_ingredients_submit in Recipe 6
Same name and namespace in other branches
- 7 recipe.module \recipe_more_ingredients_submit()
Submit handler to add more ingredient rows. It makes changes to the form state and the entire form is rebuilt during the page reload.
1 string reference to 'recipe_more_ingredients_submit'
- recipe_form in ./
recipe.module - Implementation of hook_form().
File
- ./
recipe.module, line 438 - recipe.module - share recipes
Code
function recipe_more_ingredients_submit($form, &$form_state) {
// Set the form to rebuild and run submit handlers.
node_form_submit_build_node($form, $form_state);
// Fake an empty preview.
// #341136: Taxonomy selection loses value on button click
$form_state['node_preview'] = '';
// Make the changes we want to the form state.
if ($form_state['values']['ingredients']['recipe_more_ingredients']) {
$form_state['add_ingredients'] = 1;
}
}