i tried to create a javascript event that detects when the * key is pressed. code:
function asterisk(e) {
var evtobj = window.event ? event : e //distinguish between IE's explicit event object (window.event) and Firefox's implicit.
var unicode = evtobj.charCode ? evtobj.charCode : evtobj.keyCode
var actualkey = String.fromCharCode(unicode)
alert(actualkey);
if ((actualkey == "8" && evtobj.shiftKey) || actualkey == "*") {
alert("banana");
var tbbar = document.getElementById("tbBarcode");
var tbam = document.getElementById("tbAmount");
tbam.value = tbbar.value;
tbbar.value = "";
tbbar.focus();
}
}
when i press the * key on the number pad (the right side of the keyboard, not the shift+8 one) the alert says "j" insted of "*" why is that happening?