Home: Other Programming Languages: Javascript:
Back button in browsers



varo
stranger

Jul 18, 2001, 6:49 PM


Views: 18928
Back button in browsers

How do I disable the back button from a browser.
in order to prevent users from returning to the previous page with the back button.

I have information in the previous page that was submitted by forms. I don't want the users to submit the information again.



BrightNail
Novice

Jul 28, 2001, 3:57 PM


Views: 18916
Re: Back button in browsers

hey,
are you in frames...?
If your in frames,, when a user Hits submit, he/she then sets a variable in another frame. Since the frame is always there, the set variable will still be there even if someone goes back to the page. SOOO, when someone submits, the variable in another frame is checked...its false (that is the default setting), so it submits...document.submit()...then have the javascript set the variable in the other frame to "true"....if the variable was true, then the form wouldn't submit, or it can launch an alert....

If you don't have frames, you can use a cookie, or check the history of the URL, if your coming from a certain url, then on your form page, it redirects....