I have a page which looks like http://notfound.stackexchange.com?a=1&b=2

After validation, i use form_set_error to display a drupal error message on the same page(url) but end up without the url params http://notfound.stackexchange.com


  • Is there a way to preserve/persist the url params on form_set_error ?
  • Is using drupal_goto the correct way (since i can send the url params again) to redirect to the same page ?
  • hidden form elements to store the params for use on different pages in the process flow, but as a last resort if there is no other way ?
  • Please let me see your drupal_goto code. – niksmac Mar 13 '14 at 15:41
  • @NikhilM : drupal_goto($url, array('query' => array('a' = $value1, 'b' = $value2))); – nata.inc Mar 14 '14 at 14:31

$form_state['redirect'] = FALSE;

This works like a charm since the form is not rebuilt or reloaded. Below link contains more info https://drupal.org/node/1850410

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.