Friday, August 17, 2007

Trap F1 key in IE, ByPass Showing Help Window

Blocking F1 keys using javascript,

<html>
<head>
<script>
function ByPass()
{
var kCode = window.event.keyCode;
       if(kCode == 112)
      {
             alert('F1 Clicked'); // Alter Code As Your Wish
       }
}
</script>
</head>
<body onhelp="return false;" onkeydown="ByPass()">
</body>
</html>


Note: Tested In IE 7

1 comment:

Anonymous said...

Thanks, this post helped me!

JP