2

After submitting contact form (on contact page), the user automatically is sent (redirected) to front page. How can I avoid it? (user remain on contact page)

Thanks

5

You can use form_state['redirect'] in your form alter,

function MODULE_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == ''contact_us_form) {
      $form_state['redirect'] = array('contact/us');
  }
}
  • 4
    You could use a more dynamic path than contact/us with a function like current_path(). That way, it should work even if you change the path to something else, or if you use translated pages i18n. However, it won't work if you want to send the user to another page then the current one. – hampusn Sep 11 '12 at 7:32
1

Create a Rule on webform submission and redirect user to front page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.