Hello,
After submitting a form, I want my users to be redirected to another form if a checkbox is checked. The drupal path I want to redirect to is 'node/add/organization' . So far my checkbox displays fine. I am using hook_form_alter() to add the new checkbox field and include my custom function in the $form['#submit'] array of functions.
Here's my custom function's code:
function my_custom_function($form, $form_state) {
if (isset($form['redirect_checkbox']['#value']['redirect'])) {
$form_state['redirect'] = 'node/add/organization';
}
}
?>
This however is not doing the trick.
Some more info I found hacking around my local development environment:
- I used the watchdog() function to see what functions are being called when I click on submit. Here's what I got (in order of execution) : node_form_validate, node_form_submit, menu_node_form_submit, my_custom_function
- I also add a watchdog to see what parameters are going to drupal_redirect_form() and saw that it was being called with $form_state['redirect'] = 'node/222'
Any help would be appreciated, thanks.
Read »








