This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one 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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cancel button should take to previous page