Home > ASP.Net, General > IE Form Not Submitting on Enter

IE Form Not Submitting on Enter

Today, i observed yet another weired behavior in IE. My ASP.Net form just had a single text field and a button (<asp:Button /> control).

Form works fine in Chrome and Firefox, but in IE form is not posted back on pressing enter while the focus is inside the text box. Pressing enter simply reloads the current page while it works fine with other browsers.

This was quite a strange thing to me – while searching for the issue, i found that IE behaves this way if you have only one field in the form, what a strange bug in IE :).

Moreover, this issue only occurs if we are using ASP.Net, in simple HTML pages, it works fine.

This issue can be resolved by adding more fields to the form. If you just require a single field in the form (as i do), add a dummy field and hide it from display.

Categories: ASP.Net, General
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: