Drupal - Use hook_form_alter() to set redirect path on the form
One popular use of this hook is to change the destination of a form submission. Here is how it is accomplished:
<?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...
Again another piece of useful code. it's so hard to find good documentation for Drupal.
Post new comment