• buttons need type="submit" to submit in IE

    Dec 26 2008

    In a typical round of doing Internet Explorer clean up at the end of a project, I had to figure out why my <button>Submit</button> wasn't submitting a form in IE.

    I did a search on "html button" and went to the w3c HTML 4.01 specifications:

    type = submit|button|reset [CI]

    This attribute declares the type of the button. Possible values:

    submit: Creates a submit button. This is the default value.
    reset: Creates a reset button.
    button: Creates a push button.

    So the default is submit. But Internet Explorer has obviously forgotten this in IE6 and IE7. I found it worked without type="submit" in Firefox, Safari, Chrome and Opera. I haven't tested in IE8 because I don't have it installed. Maybe someone wants to check it out? Here is a demo page.

    So I guess we should get in the habit of using:

    <button type="submit">Submit</button>