Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

Feedback on: irt.org FAQ Knowledge Base Q1345, Thursday May 17, 2007 at 07:16:15

You are here: irt.org | About | Feedback | 4587 [ previous next ]

Feedback on:
irt.org FAQ Knowledge Base Q1345

Sent by
Naresh Thandu on Thursday May 17, 2007 at 07:16:15

Worth:

Length:

Technical:

Comments:
<script language="JavaScript"><!--
document.onkeydown = mykeyhandler;

function mykeyhandler() {
if (window.event && window.event.keyCode == 8) {
// try to cancel the backspace
window.event.cancelBubble = true;
window.event.returnValue = false;
return false;
}
}
//--></script>

Here in the above script just check out for the event's source element's tag name.If cursor is not focussed in any text box you will find out the tag name 'body',other wise you will get 'input'.
It can be done in this way
function mykeyhandler() {
if (window.event && window.event.keyCode == 8 && window.event..srcElement.tagName == "BODY") {
// try to cancel the backspace
window.event.cancelBubble = true;
window.event.returnValue = false;
return false;
}
}





Other feedback on 'irt.org FAQ Knowledge Base Q1345' - show all

©2018 Martin Webb