Please let me know how to disable back button in Browser
Disable back button in Browser
Collapse
X
-
hi ...
you cannot do that ... and it would be very annoying, because that button has its purpose ... but you may use the onbeforeunload-event of the current document to call some javascript that you want to have performed when leaving the page ...
kind regards -
disable back button in Browser....Originally posted by me2techPlease let me know how to disable back button in Browser
Pls try this code inside Javascript function
[CODE=javascript]document.onkeyd own = BackBtnCancel;
function BackBtnCancel()
{
var e = event.srcElemen t.tagName;
if(event.keyCod e == 8 && e != "INPUT" && e != "TEXTAREA" )
{
event.cancelBub ble = true;
event.returnVal ue = false;
}
}[/CODE]
It really works....Comment
-
yep ... this has to be adapted for cross-browser-capability and doesn't solve the original problem ... but it would help to avoid an accidently 'back - action' ...Originally posted by mrhoodeepakunny's function disables the backspace key, not the browser back button, and it will throw an error if the browser is not IE.
kind regardsComment
Comment