This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Cancel button should take to previous page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Cancel button should take to previous page" Watch "Cancel button should take to previous page" New topic
Author

Cancel button should take to previous page

John Lincoln
Ranch Hand

Joined: Feb 11, 2003
Posts: 192
Hi,

I am having servlet, which has 5 jsps. Each jsp has does a post and two buttons submit and cancel. the submit works fine, but whne i hit cancel it should take me to the previous page.


How this can be done ? On click of cancel should i set some variable using script.

Please help.

thanks
Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 818


I added the double quotes to make the code neater. This should send you back 1 page in history. If you want to go back 2 or more just supply the number of pages back inside the back function call (i.e. back(5) for 5 pages back).

Hope this helps.
Rob
 
 
subject: Cancel button should take to previous page