IE Undefined event works in Firefox

I have an onKeypress event in the text box This works in FireFox, not in IE

event is passed as undefined in IE

PriceInBox.onkeypress = function(event) { return moZoltarCurrent.evt_checkForInt(event); } 
+6
javascript internet-explorer
source share
1 answer

You need to normalize the Event interface, since IE does not pass it as a parameter, but uses a global variable:

 PriceInBox.onkeypress = function(event) { event = event || window.event; return moZoltarCurrent.evt_checkForInt(event); }; 
+7
source share

All Articles