Log in

View Full Version : How do I disable the browser's back button?



Captain P
07-23-2008, 07:42 PM
I have a web page set up for a couple of thousand internal users. I have password protected the management page but, if you navigate away and click back it takes you directly to the page instead of the password page. Is there anyway of disabling the back button on that page?

jscheuer1
07-23-2008, 08:02 PM
Not in HTML or any of the other languages generally covered in this form. I imagine you would need to make your own proprietary version of a particular browser or browsers and require all of your user to use it. Any generic browser has a back button and it cannot be disabled using client or server side code. You could probably track where your users have been on the server side and redirect them if they return a second time, but that would probably apply regardless of how they got there the second time, no way to tell if it was via the back button or not. But to actually disable the button, not with out creating a browser that has none.

blm126
07-23-2008, 08:27 PM
In some browsers you could accomplish what you want by using a popup(where it is possible to disable certain parts of the browser UI). For this to have a chance of working you need to be able to dictate to your users exactly what browser and version they use so as to make sure it works. However, with that said, I would be more apt to change the server side code so that it doesn't allow someone to access the page without going through the password page.

jscheuer1
07-23-2008, 09:10 PM
Even with that Brady, the user can do a ctrl-n or equivalent to get a new browser window and then do as he or she sees fit.