W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2017

Re: [whatwg] RadioNodeList and buttons

From: Regis Kuckaertz <Regis.Kuckaertz@theguardian.com>
Date: Tue, 31 Oct 2017 14:56:45 +0000
Message-ID: <CAA=eSOp9c4T-Y-KPR+oG8+a3R9SCP-9QMgbO_9fEnp5Ga57c9Q@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: whatwg@lists.whatwg.org
Thanks for your question. Phrased like that, it becomes clear to me that I
did not think enough about how the value would be computed in the case of a
set of buttons. There is no "checkedness" in buttons, not that I know of.

Indeed I find your idea more appealing and semantically clearer. When I
wrote the example, I thought the name attribute on buttons was redundant
with the type attribute.

On Tue, 31 Oct 2017 at 14:23 Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 10/31/17 6:23 AM, Regis Kuckaertz wrote:
> > formElement.onsubmit = (evt) => {
> >    evt.preventDefault();
> >    const button = evt.target.elements.namedItem('action');
> >    const value = button.value
>
> If this returned buttons, which button would you expect it to return in
> various situations and why?
>
> > Here is my question: if the UA handles this situation without a glitch,
> > wouldn't you expect the corresponding DOM API to expose the same
> behaviour?
>
> I just checked one UA (Firefox), and the way it handles this situation
> is that it stores the "submitter" (in the sense of the argument to
> <https://html.spec.whatwg.org/#form-submission-algorithm>) on the
> "submit" event itself.  Exposing it as a property on that event would
> make a lot of sense to me.
>
> -Boris
>

-- 

------------------------------
This e-mail and all attachments are confidential and may also be 
privileged. If you are not the named recipient, please notify the sender 
and delete the e-mail and all attachments immediately. Do not disclose the 
contents to another person. You may not use the information for any 
purpose, or store, or copy, it in any way.  Guardian News & Media Limited 
is not liable for any computer viruses or other material transmitted with 
or as part of this e-mail. You should employ virus checking software.
 
Guardian News & Media Limited is a member of Guardian Media Group plc. Registered 
Office: PO Box 68164, Kings Place, 90 York Way, London, N1P 2AP.  Registered 
in England Number 908396
Received on Tuesday, 31 October 2017 14:57:23 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 31 October 2017 14:57:24 UTC