File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Replace page after posting a form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Replace page after posting a form" Watch "Replace page after posting a form" New topic
Author

Replace page after posting a form

aishwarya bhave
Greenhorn

Joined: Nov 23, 2003
Posts: 1
Hi,
This is a probably a beginner question. I have a form in a.jsp to be posted to b.jsp.Once the form is submitted, I do not want the user to be able to go back to the a.jsp using the browser back button. I've tried using window.location.replace, in <form action = "window.location.replace(URL) method =" post"> and in the onClick of the 'Submit' button, but it seems as though I can only do one thing at a time,post the data(form fields and hidden fields) or disable the 'back' functionality.
Please help!
Regards.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Best method is to have a cookie that remembers if the form has been submitted and it does not allow another submission.

There are other techniques that have been talked about on this forum.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Replace page after posting a form