• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1358
  • Last Modified:

disable keystroke, alt+left arrow

hi experts!
how to disable alt+left arrow???
0
kokshong
Asked:
kokshong
  • 2
  • 2
1 Solution
 
justinbilligCommented:
can't be done, niether of them trigger an keypress event ... see for yourself


<html>
<body onkeypress="alert( event.keyCode );">

<FORM name=myform method=POST action="">
<INPUT type=button value="Print" onclick="window.print( );">
</FORM>
</body>
</html>
0
 
justinbilligCommented:
you know whats funny though is i didnt know that you could use alt + arrow keys to navigate your browser until this morning, then i come to work and 2 people have posted about it ... wierd
0
 
cwolvesCommented:
yes they do.  use onkeydown instead of onkeypress.

<script>
function disable(){
   if(event.altKey && event.keyCode==37) return false;
}
document.onkeydown=disable;
</script>
0
 
kokshongAuthor Commented:
thanks cwolves. but that does not work..
0
 
cwolvesCommented:
works for me  :-)

what browser?  that code is ie-specific.  same concept for mozilla tho
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now