Hey guys/Gals,
Need to capture the 10 key, when NUM LOCK is OFF:
here is what i have:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var key = new Array(); // Define key launcher pages here
key['1'] = "/drs/inq.pl";
key['8'] = "/drs/insurance-information.pl?INSURANCE=INS::CODE01";
key['9'] = "/drs/insurance-information.pl?INSURANCE=INS::CODE02";
function getKey(keyStroke) {
isNetscape=(document.layers);
// Cross-browser key capture routine couresty
// of Randy Bennett (rbennett@thezone.net)
eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;
which = String.fromCharCode(eventChooser).toLowerCase();
for (var i in key) if (which == i) window.location = key;
}
document.onkeypress = getKey;
// End -->
</script>
This works great with the numbers on the top row of the keyboard..... but i need to capture the 10 key pad when the num lock key is off. Any ideas?
- Scott
Need to capture the 10 key, when NUM LOCK is OFF:
here is what i have:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var key = new Array(); // Define key launcher pages here
key['1'] = "/drs/inq.pl";
key['8'] = "/drs/insurance-information.pl?INSURANCE=INS::CODE01";
key['9'] = "/drs/insurance-information.pl?INSURANCE=INS::CODE02";
function getKey(keyStroke) {
isNetscape=(document.layers);
// Cross-browser key capture routine couresty
// of Randy Bennett (rbennett@thezone.net)
eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;
which = String.fromCharCode(eventChooser).toLowerCase();
for (var i in key) if (which == i) window.location = key;
}
document.onkeypress = getKey;
// End -->
</script>
This works great with the numbers on the top row of the keyboard..... but i need to capture the 10 key pad when the num lock key is off. Any ideas?
- Scott