Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cancel button should take to previous page

 
John Lincoln
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 832
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic