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

Comments

2 participants
@frigus02
Contributor

frigus02 commented Dec 27, 2017

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

This comment has been minimized.

Show comment
Hide comment
@domenic

domenic Dec 27, 2017

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@frigus02

frigus02 Dec 27, 2017

Contributor

Sure, I can work on this tomorrow.

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

Contributor

frigus02 commented Dec 27, 2017

Sure, I can work on this tomorrow.

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

@domenic

This comment has been minimized.

Show comment
Hide comment
@domenic

domenic Dec 27, 2017

Member

Yep, that'll do the trick.

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

Fix example of output element to use ids instead of names
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

Fix example of output element to use ids instead of names
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

Fix example of output element to use ids instead of names
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 domenic closed this in #3313 Jan 2, 2018

domenic added a commit that referenced this issue Jan 2, 2018

Fix example of output element to use ids instead of names
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment