A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Cancel button should take to previous page
Joined: Feb 11, 2003
May 11, 2007 06:52:00
I am having
, which has 5 jsps. Each
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.
<Form method = "Post" name= form0 > <input type=submit > <inpput type=button name=cancel> </Form>
How this can be done ? On click of cancel should i set some variable using script.
Joined: Apr 09, 2002
May 11, 2007 10:40:00
<innput type="button" name="cancel" onnclick="document.hisstory.back();">
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.
I agree. Here's the link:
subject: Cancel button should take to previous page
multiple forms in JSP
problem while forwording the JSP page
Getting html form name
Onclick form submission
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015