Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 277
  • Last Modified:

when click Back Button javascript alert reppears

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
murads3
Asked:
murads3
1 Solution
 
MessiadbunnyCommented:
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now