IE7 and form submitting

Often, IE7 is regarded less standards compliant than its open source alternatives. Accidentally I ran into a – at least for me – unknown feature in IE7 which proves that in some cases IE7 can be rather strict. Take this, a FORM without a submit-button, but with a BUTTON-button:

  <!-- a lot of code -->

Firefox just submits the form when you click the button. IE7 however does nothing! It appeared that IE7 only submits the form when the attribute type is specified as type=”submit”.

  <button type="submit">fire!</button>

Cool! Seems logically in the end. Where are the times that Microsoft interpreted all your sloppy code?

Tested with a XHTML 1.0 Strict page with a FORM-element which included three BUTTON-buttons. I encountered no form submitting problems without the type attribute specified  in FF or in Opera 8.54 on Windows XP SP2. I didn’t test in IE6 or other exotic browsers.

7 replies on “IE7 and form submitting”

  1. Volgens mij is er dus alleen een probleem als je met verschillende submitbuttons binnen 1 formulier werkt en je wilt weten welke precies gebruikt is voor submitten. Dit zal meestal niet het geval zijn.

Comments are closed.