[whatwg] Requests to change <button> to match IE7.

Ian Hickson ian at hixie.ch
Tue Oct 28 16:11:26 PDT 2008


On Sat, 14 Apr 2007, Simon Pieters wrote:
>
> For compatibility with IE, <button> should default to type=button 
> instead of type=submit.

On Sat, 14 Apr 2007, Lachlan Hunt wrote:
> 
> <button> without type should default to button.
> <button type="unknown"> should default to submit.
> 
> That way, we could still introduce new button types in the future and 
> have them fall back to submit, while retaining compat with IE.

On Sat, 14 Apr 2007, Simon Pieters wrote:
>
> We currently don't have interop with IE and other browsers with regards 
> to what to send to the server as the value of <button>.
> 
> IE always sends .innerText as value.
> 
> Other browsers always send the contents of value="" as value, or the 
> empty string if it's missing (as per HTML4).
> 
> There may be content on the Web relying on IE's behavior, e.g. missing 
> value="" attribute. Still, the other browsers agree on using value="" 
> and using value="" is useful (in order to send one value to the server 
> but show different text to the user as button text), and is the way 
> other form controls work.
> 
> A middle ground could be to use value="" if the attribute is present, or 
> .innerText otherwise (pretty much like <option>).

On Sat, 14 Apr 2007, Kornel Lesinski wrote:
> 
> IIRC it's innerHTML, but I can't verify it at the moment.
> 
> Is there really a noticable number of sites that rely on IE's broken 
> behaviour? I doubt, because:
>
> * By sending contents of button instead of value, it doesn't provide 
> much more functionality than <input type=submit>.
>
> * Styling of <button> is not an easy task, so it's unlikely to be used 
> for its HTML contents - authors rather use <input type=image> or <a 
> href="javascript:sendform()">
>
> * And worst of all - IE always sends all undisabled <buttons>. This 
> makes value irrelevant, because you can't check which button was clicked 
> anyway.

On Sat, 14 Apr 2007, Simon Pieters wrote:
> 
> Apparently, enough for the IE team to not change it for IE7, despite me 
> sending a bug report about it. (The bug was closed as "by design" IIRC.)

IE8b2, WebKit trunk, Firefox trunk, and Opera 9.6 are now all consistent 
and do what the spec says:

   http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A...%3Cform%20action%3D%22..%2F..%2Fcgi%2Ftest-tools%2Fecho%22%3E%3Cbutton%20name%3Da%3Ex%3Cbr%3Ey%3C%2Fbutton%3E%3Cbutton%20name%3Db%20type%3Db%3Ex%3Cbr%3Ey%3C%2Fbutton%3E%3C%2Fform%3E

Thus, I have not changed the spec to match the above requests.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list