Solved

when click Back Button javascript alert reppears

Posted on 2006-11-15
1
258 Views
Last Modified: 2008-01-09
I'm using JSP to do form validation on postback...I show an alert message when a form field is invalid after verifying against database.  If the field is valid, we go to a Thank you page.  But if I hit the Back button I'm seeing the alert box again and have to click OK on the box to go back to the form.  How can I go back to the form from the Thankyou page without seeing the alert

Don't want to use cookies because what if that form field is entered invalid more than once when the user initially fills the form...
0
Comment
Question by:murads3
1 Comment
 
LVL 2

Accepted Solution

by:
Messiadbunny earned 500 total points
Comment Utility
I'd suggest something along the lines of checking the referral address.  So if they are coming from the thanks page then it voids all alert messages.  

  if (document.referrer != 'www.bla.com/thankspage.html')

Something along those lines.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now