How to disable Back button in IE and firefox? [duplicate]

Duplicate:


I have to disable back and forward button of browser ( IE and Firefox both ). I have tried:

//disable back button
window.onbeforeunload= function() { }   
window.history.forward(1);

but this works only in IE.
Is there any foolproof solution?

Answers:

Answer

The answer is "no". You cannot disable a browser's back button.

Or at least on a good browser.

Answer

I believe this question has already been asked:

Disabling Back button on the browser Prevent Use of the Back Button (in IE)

If you're trying to prevent the user from losing their work, try something like:

window.onbeforeunload = function() { return "You work will be lost."; };

Steve

Answer

There is no solution for that problem. You can't really "disable" it.

Answer

I would argue you should not disable the back button it at all possible as users are used to using it and it will frustrate them to find its functionality removed.

The users flow will be interrupted and they will leave your site.

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.