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>
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/
The default appears to be working in IE8 -- both forms in your demo page post just fine!
"<button type="submit">Submit</button>",IE8 works!
"<button>Submit</button>" not!
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.
@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?
Buttons blow.
@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>
Umm, yeah, no.
Nesting spans because you have no skills _proves_ you are inexperienced, weak, and you have a gay porn mustache. Beat it.
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..
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.