Msg#: 4382017 posted 11:50 am on Nov 1, 2011 (gmt 0)
Here is a test page for it:
Msg#: 4382017 posted 8:45 pm on Nov 4, 2011 (gmt 0)
I suspect the problem may be where you are attaching your event handler... at the document level. Events "bubble" up the DOM tree, so by the time your KeyCheck method is being called, the event handler at the INPUT element has already completed (including the default action). I suspect that if you attached this to the onkeyup event handler of your INPUT element instead of the document, then it might do what you expect.
Msg#: 4382017 posted 9:58 pm on Nov 4, 2011 (gmt 0)
Thank you for your reply, in the meanwhile I managed to solve my problem. You are right, it was the event handler, but I didn't bind it to the onkeyup of the INPUT, I called keydown on the INPUT and did preventDefault() there just for the 2 keys. Works great now.