Skip to content

Form Submit: Internet Explorer behaving badly

Apr 14, 2009 1 min read #html #javascript #jquery

This post is more than 18 months old. Technology changes quickly, so some of this content may be out of date (but that's not always the case). Please verify any technical or programming information against the current release.

I just want to make a micro blog here. Just a tiny lil blog.

Internet Explorer Does Not Submit Form on Enter

Correct! Instead, I load my page with this jquery

$('input').keydown(function(e) {
  if (e.keyCode == 13) {
    $(this).parents('form').submit();
    return false;
  }
});
javascript

Button Element Not Submitting in Internet Explorer

Correct! Mainly because I was lazy.

But in FireFox works fine for a submit.

In IE - don’t forget to add type="submit"

<button>Works in FF</button>
<button type="submit">Works and is probably what you SHOULD do</button>
html

That is all.