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

New error messages in Chrome console regarding form fields and "for=FORM_ELEMENT" attributes. #505

Open
jmelott opened this issue Jun 14, 2023 · 0 comments

Comments

@jmelott
Copy link

jmelott commented Jun 14, 2023

Apparently Chrome has become stricter in regards to following specifications the form fields and associated for statements. "for " attributes in labels are supposed to point to input type elements and the viewer has some that point to the surrounding div instead of to the input field. This is causing an error in the console in chrome Version 114.0.5735.134 (Official Build) (64-bit). The error is coming up for the "Map Name" label which points at the div mapName. Since the mapName isn't an input field, perhaps getting rid of the for attribute in the label is the correct action?

Also the labels for Search: and Orientation: are causing warnings in the console because they don't have for statements for the labels.

bmbroom added a commit that referenced this issue Jun 14, 2024
Chrome now complains about label elements with missing or incorrect "for"
attributes. See issue #505.

I found four <label> elements in chm.html that were semantically labels,
but not labels in the strict HTML sense as referring to a specific form
input element.

I changed them to plain <span> elements.  Since we weren't formatted them
any differently from plain elements, I didn't add a class field that we
could use as a css selector in the future.  I could easily be convinced to
add one.
ChrisWakefield pushed a commit that referenced this issue Jun 19, 2024
Chrome now complains about label elements with missing or incorrect "for"
attributes. See issue #505.

I found four <label> elements in chm.html that were semantically labels,
but not labels in the strict HTML sense as referring to a specific form
input element.

I changed them to plain <span> elements.  Since we weren't formatted them
any differently from plain elements, I didn't add a class field that we
could use as a css selector in the future.  I could easily be convinced to
add one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant