disable keystroke, alt+left arrow

hi experts!
how to disable alt+left arrow???
kokshongAsked:
Who is Participating?
 
cwolvesConnect With a Mentor Commented:
yes they do.  use onkeydown instead of onkeypress.

<script>
function disable(){
   if(event.altKey && event.keyCode==37) return false;
}
document.onkeydown=disable;
</script>
0
 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.