By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,607 Members | 1,764 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,607 IT Pros & Developers. It's quick & easy.

stop F1 key to F12 keys

100+
P: 115
hi All

i would like to disable all functional keys(F1 to F12 ) using javascript code. Is it possible?

let me know the answer

pls response immd
May 28 '08 #1
Share this Question
Share on Google+
3 Replies


hsriat
Expert 100+
P: 1,654
See if this works..
Expand|Select|Wrap|Line Numbers
  1. document.onmousedown = function (event) {
  2.     event = (event || window.event);
  3.     if (event.keyCode > 111 && event.keyCode < 124) {
  4.         //alert('No F-keys');
  5.         return false;
  6.     }
  7. }
May 28 '08 #2

gits
Expert Mod 5K+
P: 5,390
See if this works..
Expand|Select|Wrap|Line Numbers
  1. document.onmousedown = function (event) {
  2.     event = (event || window.event);
  3.     if (event.keyCode > 111 && event.keyCode < 124) {
  4.         //alert('No F-keys');
  5.         return false;
  6.     }
  7. }
i wonder ... shouldn't it be the keypress-event instead of the mousedown? :)

kind regards
May 28 '08 #3

hsriat
Expert 100+
P: 1,654
You can't be wrong gits. I could be.



Expand|Select|Wrap|Line Numbers
  1. document.onkeypress = function (event) {
  2.     event = (event || window.event);
  3.     if (event.keyCode > 111 && event.keyCode < 124) {
  4.         //alert('No F-keys');
  5.         return false;
  6.     }
  7. }
May 28 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.