Enter button does not submit form (IE ONLY) ASP.NET
asp.net, internet-explorer, javascript, textbox
Solution
The other thing I have done in the past is wrap the form area in a Panel and set the DefaultButton attribute to the submit button you have. This effectively maps the enter key to the submission as long as you have a form element in focus in the panel area.
Problem
I have a form with a textbox and a button. IE is the only browser that will not submit the form when Enter is pressed (works in FF, Opera, Safari, Chrome, etc.). I found this javascript function to try to coax IE into behaving; but no avail: ``` function checkEnter(e){ var characterCode if (e && e.which) { e = e characterCode = e.which } else { e = event characterCode = e.keyCode } if (characterCode == 13) { document.forms[0].submit() return false } else { return true } } ``` Implementation: ``` searchbox.Attributes("OnKeyUp") = "checkEnter(event)" ``` Any advice? EDIT: This page on CodeProject outlines what Dillie was saying, and it works perfectly.