Problem:
I have an input box where the onKeyDown event will check if the key pressed was enter, and submit the form on enter. This works fine, but in IE 7 the browser beeps when you press enter, and submits the form.
Solution:
This happens because 'enter' is not valid within the context of an input box, according to IE. Thus, pressing it will cause the beep. What you need to do to remove the beep, is to return false from the function which does the submit. It looks something like this:
<input onkeydown="return postOnEnter(event)"/>
obviously, i am calling some custom functions in the snippet above, but the location of the return statements, and their values is all that matters.
Thanks, this helped me.
ReplyDeleteThank you very much! This helped me out after weeks of searching for an answer to this nonsensical problem.
ReplyDeleteThanks man , this saved me time.Thank you very muck.I really hate IE.
ReplyDeleteThanks.
Thanks! this was just what I was looking for!
ReplyDeleteWow, I spent hours trying to figure this out, thank you sooooo much for the answer. :)
ReplyDeleteThank you! This is exactly what I needed to fix this problem. Stupid IE...
ReplyDelete