the Future of the Web
  • Home
  • Articles
  • Contact
  • 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>
    Tags: html ie standards w3c
    View 12 Comments | Add a comment
  • Comments

    1. Артём Курапов at 8:21pm on December 26, 2008

    Yep, same thing. I guess I'll add it to my list of "why form is not submitting" list (in russian though)
    http://kurapov.name/technology/ui/js/submitting_form/

    2. Mark at 11:48pm on December 26, 2008

    The default appears to be working in IE8 -- both forms in your demo page post just fine!

    3. kangax at 10:46am on December 27, 2008

    Yep, IE8 works

    4. cnspider at 8:07pm on January 11, 2009

    "<button type="submit">Submit</button>",IE8 works!
    "<button>Submit</button>" not!

    5. jack at 2:35pm on January 22, 2009

    Why would you use <button> instead of <input>?

    Are you guys new to web development? I thought you were supposed to be experts?

    Use:
    <input type="submit" value="Text to appear on button" />

    And then you won't have to post to your blog and expose how inexperienced you are when you can't make a submit button work.

    Ugh.

    6. Jesse Skinner at 2:48pm on January 22, 2009

    @jack I never used to use buttons either, I only started using buttons recently, hence the learning bump.

    I like buttons. I think they're swell. What's wrong with buttons?

    7. jack at 4:42pm on January 23, 2009

    Buttons blow.

    8. Kenneth Sundqvist at 9:53am on January 29, 2009

    @jack

    Not knowing when to use <button> instead of <input> makes YOU look really inexperienced.

    I'm using it right now because I need to style the submit button with a sliding doors technique that works in FF3 and IE6+7.

    <button><span><span>Jack is rude and ignorant</span></span></button>

    9. jack at 11:03am on February 4, 2009

    Umm, yeah, no.

    Nesting spans because you have no skills _proves_ you are inexperienced, weak, and you have a gay porn mustache. Beat it.

    10. Bob at 12:00pm on March 16, 2009

    The world would be a better place w/o trolls like Jack.

    11. jaycverg at 4:12am on April 22, 2009

    hey guys, this is suppose to be a learning blog, heheeh, please stop that...


    well i'm using <input type="submit"  /> in my works since JSF's <h:commandButton /> generates that..

    12. jaycverg at 4:18am on April 22, 2009

    if you put <button /> tags inside a form, the values submitted will vary from browser to browwer. Internet Explorer will submit the text between the <button> and </button> tags, while other browsers will submit the content of the value attribute. Use the input element to create buttons in an HTML form.

    Add a Comment

    Note: HTML tags and entities will be converted so that they are displayed as you type them. This means if you type in <em>, people will see <em>, and if you type &lt;em&gt;, people will see &lt;em&gt;.

  • Request a Quote

  • Jesse Skinner

    Jesse Skinner
    • About Me
    • Email Me
    • RSS Feed RSS Icon
    • @JesseSkinner
  • Recent Articles

    • jQuery Live Events
    • I need web developers
    • buttons need type="submit" to submit in IE
    • Win $200 in a Web Dev Writing Contest
    • Use Arrays in HTML Form Variables
    • 5 Reasons Freelancers Can Succeed in a Shrinking Economy
    • Keeping a Live Eye on Logs
    • Using PHP's empty() Instead of isset() and count()
    • Testing Web Pages with Lynx
    • Stop CSS Background Flickering in Internet Explorer 6
    • See All...
  • Categories

    • javascript (39)
    • links (21)
    • about (19)
    • web (14)
    • html (12)
    • server (11)
    • css (8)
    • browsers (8)
    • carnival (7)
    • work (6)
    • design (4)
    • seo (4)
    • ads (4)
    • standards (4)
    • events (4)
  • Older Articles

    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • January 2007
    • December 2006
    • November 2006
    • October 2006
    • September 2006
    • August 2006
    • July 2006
    • June 2006
    • May 2006
    • April 2006
    • March 2006
    • February 2006
    • January 2006
    • December 2005
    • November 2005
    • October 2005
    • September 2005
    • August 2005
    • April 2005
    • See All...
Copyright © 2010 The Future of the Web