[whatwg] [WF2] <button> without value="" should perhaps use .innerText as value
Simon Pieters
zcorpan at gmail.com
Fri Apr 13 18:10:07 PDT 2007
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>).
Test cases for the above proposal:
<form><button type=submit name=test value=PASS>FAIL</button></form>
<form><button type=submit name=test>PASS</button></form>
--
Simon Pieters
More information about the whatwg
mailing list