Last updated June 20, 2009. Created by zzolo on June 20, 2009.
Log in to edit this page.
If you would like to redirect the node form after it has been submitted. It is a simple matter of supplying the #redirect attribute of the form.
<?php
/**
* Implementation of hook_form_alter
*/
function custom_module_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'node_type_form') {
// Get the redirect page from some place,
// like in the URL, Referring URL, or DB
$redirect = check_plain($_GET['redirect']);
// Set form redirect
$form['#redirect'] = $redirect;
}
}
?>
Comments
That redirect would work also
That redirect would work also on Delete button, so i think it's not 100% correct.
In a healthy body - healthy mind