Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example for <output> uses name instead of id when referring to for elements #3312

Closed
frigus02 opened this issue Dec 27, 2017 · 3 comments · Fixed by #3313
Closed

Example for <output> uses name instead of id when referring to for elements #3312

frigus02 opened this issue Dec 27, 2017 · 3 comments · Fixed by #3313

Comments

@frigus02
Copy link
Contributor

I'm a bit confused by the text about the <output> element and its for attribute.

When I understand it correctly, it says the for attribute is a list of IDs of other form elements:

The for attribute, if specified, must contain a string consisting of an unordered set of unique space-separated tokens that are case-sensitive, each of which must have the value of an ID of an element in the same tree.

The spec then shows an example, which demonstrates how to use the <output> element. Here it uses a list of names of other form elements:

<input name=​a type=​number step=​any> +
<input name=​b type=​number step=​any> =
<output name=​o for=​"a b"></output>

I assume I'm missing something. Is the name of a form element considered an id? Thanks in advance for your help.

@domenic
Copy link
Member

domenic commented Dec 27, 2017

To me this looks like a straightforward spec bug. Good catch! Would you be interested in submitting a pull request to fix it?

@frigus02
Copy link
Contributor Author

frigus02 commented Dec 27, 2017

Sure, I can work on this tomorrow.

Just to clarify: the example should use IDs, right?

@domenic
Copy link
Member

domenic commented Dec 27, 2017

Yep, that'll do the trick.

frigus02 added a commit to frigus02/html that referenced this issue Dec 28, 2017
The first example of the output element incorrectly referenced input
elements in the "for" attribute by their names. This changes the
example to reference input by their ids instead (whatwg#3312).
frigus02 added a commit to frigus02/html that referenced this issue Dec 28, 2017
The first example of the output element incorrectly referenced input
elements in the "for" attribute by their names. This changes the
example to reference input elements by their ids instead (whatwg#3312).
frigus02 added a commit to frigus02/html that referenced this issue Dec 30, 2017
The first example of the output element incorrectly referenced input
elements in the "for" attribute by their names. This changes the
example to reference input elements by their ids instead (whatwg#3312).
domenic pushed a commit that referenced this issue Jan 2, 2018
The first example of the output element incorrectly referenced input
elements in the "for" attribute by their names. This changes the
example to reference input elements by their ids instead.

Fixes #3312.
alice pushed a commit to alice/html that referenced this issue Jan 8, 2019
The first example of the output element incorrectly referenced input
elements in the "for" attribute by their names. This changes the
example to reference input elements by their ids instead.

Fixes whatwg#3312.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants