Disabling the back button in Browser

I would like to diable the back button of the browser!but Window.history.back=flase; does notr seems to be working!
Any idea experts!
Who is Participating?
You can't disable the back button -- you can't disable ANY buttons on the browser without a signed script, activeX control, or opening a new window without the toolbar/menubar.

You CAN use a replace to simulate it, but why? Unless it's a form that you're trying to keep from having resubmitted, having the back button not work as is expected just makes people annoyed, it doesn't keep them on your site.

And it's easy enough to get around... there are numerous ways.
WebWoman is right, you can't completely disable the back button, there are a lot of goofy things you can do to try to keep them around a page, but users can always get around them.

The easiest little roadblock I use is putting the code:

<script language=JavaScript>

at the top of the page. Every time a user comes to that page, it will push them ahead in the history queue. If they clicked to this page, they will stay there, if they used "back" to get thhere, it will just bump them forward.

It's not pretty and it's not foolproof either, turning off Javascript will get around this.

If you have a captive audience that requires Javascript, this is great, it it's going on the live net, most people should have javascript enabled.

Hope this helps a little,
so why does everyone like to do stupid stuff like this? it's like spawning tons of new windows... not a good way to get repeat visitors.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

msdixon, exactly -- all it does is annoy your users and drive them away. If I can't go back to what may be one of YOUR pages, I'll just go somewhere else ENTIRELY -- completely off your site -- and I'll probably never return.

Same thing with disabling right click, opening a new window that won't drop behind or allow me to close it, etc. I will, if necessary, force quit out of an app -- and less experienced users will just SHUT THE THING DOWN -- and I can pretty much GUARANTEE you that if somebody has to go to that type of extreme to get rid of your site, they will never, never EVER go back.

That's as bad as the scripts that force themselves as your home page, and load and won't go away everytime you open the browser. People WILL find a way to get rid of them (if it means they have to reformat and reinstall the entire OS), and they will not, no matter what you do, EVER return to your site.

So you got a few more hits? What did it accomplish, really?
robertAuthor Commented:
Hi guys,
thanks for ur comments.
I understnad ur concern.But eventhough I disable the back button ,still the user can go back through the back button designed on my application.This is the way the application works.If the user uses the back button on the browser , he will be taken to the logon page.This was designed to keep in mind the security of the application.ie this a financial app,
hope u guys got the point.

I would like to do this because I don't want forms to be submitted multiple times, a problem even on this site.  Granted for a public web site this would be annoying but I develop internal applications for my company, so that's not an issue.
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
   In the absence of responses, I may recommend DELETE unless it is clear
   to me that it has value as a PAQ.  Silence = you don't care

It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

points to webwoman


If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Comment from expert accepted a answer

E-E Admin
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.