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

Re: [whatwg] RadioNodeList and buttons

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Tue, 31 Oct 2017 10:23:07 -0400
To: whatwg@lists.whatwg.org
Message-ID: <8457b8da-a45b-515d-4355-753534582bd6@mit.edu>
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.

Received on Tuesday, 31 October 2017 14:23:40 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:44 UTC