One popular use of this hook is to change the destination of a form submission. Here is how it is accomplished:
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; } } ?> |
Again another piece of useful code. it’s so hard to find good documentation for Drupal.
Two points;
First – what version of drupal does this apply to?
Second, if this is drupal 7, it doesn’t work.