One popular use of this hook is to change the destination of a form submission. Here is how it is accomplished:
PHP
1 2 3 4 5 6 7 8 9 10 11 |
<?php function YOURMODULE_form_alter($form_id, &$form) { switch ($form['#id']) { case 'node-form': if ($form['type']['#value'] == 'story') { $form['#redirect'] = 'new/url'; } break; } } ?> |