Re: Button Element in IE8

On Wed, Dec 17, 2008 at 1:13 AM, Travis Leithead wrote:
>
> I've got a customer pointing me to http://www.kloots.net/ie8/bug-01.php,
> which demos a supposed IE8 bug. However, I've searched HTML4 and HTML5 and
> can't find any normative text that backs up the author's claim that it's
> wrong to submit the BUTTON's value if the button is not of type=submit.
>
> Is this really a bug?>

Yes.
http://www.w3.org/TR/html4/interact/forms.html#adef-type-BUTTON
"""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."""
Where "push button" links to:
http://www.w3.org/TR/html4/interact/forms.html#push-button
""Authors may create three types of buttons:
 * submit buttons: When activated, a submit button submits a form. A
form may contain more than one submit button.
 * reset buttons: When activated, a reset button resets all controls
to their initial values.
 * push buttons: Push buttons have no default behavior. Each push
button may have client-side scripts associated with the element's
event attributes. When an event occurs (e.g., the user presses the
button, releases it, etc.), the associated script is triggered."""

Isn't it clear that <button type=button> does *not* trigger a form
submit? (except if a script handle the "click" event with
form.submit())

> If so, can you conjure up some clarifying text in
> section 4.10.5?

How isn't HTML5 even clearer already?
"""Submit Button
   If the element has a form owner, the element must submit the form
owner from the button element.

Reset Button
   If the element has a form owner, the element must reset the form owner.

Button
   Do nothing."""
http://dev.w3.org/html5/spec/Overview.html#attr-button-type-button-state

-- 
Thomas Broyer

Received on Wednesday, 17 December 2008 00:31:20 UTC