Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created my own module and it has a form that is created using the Form API. The problem is that when a user clicks on a link on the form after hitting the submit button, and goes to the link, and then hits the BACK button on their browser, then the user gets a message of "Document expired. The document is no longer available".

How can I make it so that the user can hit their BACK button and be taken back to the form?

share|improve this question

A better solution might be to add a link on the page that the user sees after the form, that takes them back to the form. You might need to put back in some session values. If the form was already submitted, you'll want to decide whether to load their submission or take them to a blank, new form.

share|improve this answer
You go to google.com. You put in a search. You hit the google search button. You click on a result and you are taken to an external website. But you click the BACK button, and you are back at google. This is the same behavior I want. I can do without saving the form field values and starting with a blank form again. Putting a big link to return to the form is not what I want. It is quite possible that some of the link results are external and I have no control over it. – user785179 Dec 4 '12 at 0:23
up vote 0 down vote accepted

I didn't really solve the issue technically, but I used a workaround and made my links use "target=_blank" to force open in a new tab/window. This prevents the user from hitting the BACK button. It's not a clean solution, but will suffice. :(

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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