views:

62

answers:

1

I have onKeypress Event in Text Box This Works in FireFox, does not in IE

event is passed as undefined in IE

PriceInBox.onkeypress = function(event) { return moZoltarCurrent.evt_checkForInt(event); }
+5  A: 

You need to normalize the Event interface, as IE doesn't pass it along as a parameter, but uses a global variable:

PriceInBox.onkeypress = function(event) {
    event = event || window.event;
    return moZoltarCurrent.evt_checkForInt(event);
};
Marcel Korpel
Awesome It Works Thanks....
Praveen
This long-standing irritation is *finally* fixed with the event model changes in IE9 Standards Mode.
bobince
IE9 really does look to be making up a lot of ground standards-wise.
Tim Down