I am attempting to limit which characters may be input into a textbox by capturing the onkeypress event. The following (simplified) snippet works just fine in Google Chrome and Internet Explorer but not Firefox:
function CheckKeyPress(e) {
alert("Check point #1");
var x = e || window.event;
var key = (x.keyCode || x.which);
alert("Check point #2");
// do some stuff here
return
}
Firefox does not trigger the second alert. Why not?
Any and all responses are greatly appreciated.