Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Feedback on: irt.org FAQ Knowledge Base Q1345

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


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 21st December 2007. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.