mashraf
06-23-2003, 10:57 AM
Hi,
I want to take some action when user presses any key other
than arrow and pageup and page down. This script is suppose to
do the job, if I am not wrong.
Why it is not working. Please take a look.
Thanks,
Mashraf
<script type="text/javascript">
function keyUP(e){
var trigger = (document.all)?event:e;
keyValue = String.fromCharCode(trigger.keyCode);
if (trigger.keyCode <= 32 && trigger.keyCode >= 41)
{
alert(keyValue+" was pressed")
}
}
if(!document.all){
document.captureEvents(Event.KEYUP);
}
document.onkeyup = keyUP;
</script>
I want to take some action when user presses any key other
than arrow and pageup and page down. This script is suppose to
do the job, if I am not wrong.
Why it is not working. Please take a look.
Thanks,
Mashraf
<script type="text/javascript">
function keyUP(e){
var trigger = (document.all)?event:e;
keyValue = String.fromCharCode(trigger.keyCode);
if (trigger.keyCode <= 32 && trigger.keyCode >= 41)
{
alert(keyValue+" was pressed")
}
}
if(!document.all){
document.captureEvents(Event.KEYUP);
}
document.onkeyup = keyUP;
</script>