Click to See Complete Forum and Search --> : Disabling BACK button in browser
jazzsingh
03-11-2003, 08:06 AM
I would like to disable the back button on browswer so a user cant go back to the page where he submitted a form from (preventing multiple sumbits) I want take away the functionality to go back to the original form.
If any other solutions are possible please let me know too.
This was discussed in this thread: http://forums.webdeveloper.com/showthread.php?s=&threadid=4068&highlight=disable+back
And, to add another way, you could use PHP, to check the referring url. And, if it is the page that your form re-directs to after submission, you can send them to any page you would like...
jazzsingh
03-11-2003, 08:35 AM
I am looking for help in code for the following which was dicussed in the link u have give me ......
This might work ... do disalble the user from going back to the page
FROM THE LINK PROVIDED
"If you have the splashscreen open a new window with your page in immediately, then close itself, the back button will be grayed out. This would prevent use of the back button AT ALL, though, so could annoy visitors. Is that the sort of thing you were looking for? If that effect is what you were looking for, it is the only way to do it because of how IE and Netscape work. "
Actually, I think this might be a better bet in your situation:
Originally posted by cijori
You could use a splash screen, actually. Make a page as your index that automatically immmediately lodas your other page. Then, if they hit back, that page will send them back.
jazzsingh
03-11-2003, 08:45 AM
What happens if they hit back twice from the slpash screen ... would it go to the first page ?
2 --- you mentioned using referring url in PHP ... do you have a link for some sample code on this ???
The PHP would look something like this:
rename page to a .php extention
<?PHP
if ($_SERVER["HTTP_REFERER"] == "http://www.yoursite.com/yourpage.htm")
{
header ("Location:http://www.yoursite.com/yourpage.htm");
}
?>
Nevermore
03-11-2003, 01:02 PM
You could just open it in a window with no toolbars.
jazzsingh
03-11-2003, 04:12 PM
That does not help as ---- if you click the right mouse key ... BACK still shows up as an option
So basically I am looking for a way to disable the BACK Butoon ...
ISNT there a way to disble it through some object ??? there has to be a easier way...
No, javascript cannot disable the back button.
khalidali63
03-11-2003, 04:24 PM
Honestly speaking,browsers back button is there for a reason,and any effort to disable it is utterly un-ethical, we must not control users coming to or going away from a site.
I am so much agreed now with the notion that the onUnload event should be taken out from the event lists of the browsers.
Cheers
Khalid
Nevermore
03-12-2003, 01:18 PM
The only way which I can think of to completely eliminate the back button so that it cannot be used, is to create your own mini browser, for example in flash or Java, and fill the screen with it. The window stays at the same location, and the mini-browser moves from URL to URL. Not a very pretty solution, bu the only one.