act-rules / act-rules.github.io

Accessibility conformance testing rules for HTML
https://act-rules.github.io/
Other
136 stars 67 forks source link

Rule idea: form field has programmatic label #2055

Open Jym77 opened 1 year ago

Jym77 commented 1 year ago

Now that we have Secondary mappings and may skip the primary ones, it feels we can get a rule like:


Applicability: Form fields Expectation: Each target has a programmatic label

Maps to: secondary 3.3.2 and 1.3.1


The idea being that if there is no "(WCAG) label", it is a failure of 3.3.2, and if there is a "label" but it is not programmatic, it is a failure of 1.3.1. This matches the discussions in the Understanding document of 3.3.2 (and 2.4.6). There may be a small caveat with 3.3.2 requiring labels or instructions, so there could be an edge case of a form field with instructions but no label (and so no programmatic label) without it being a problem. I'm not fully sure what it would look like, nor how frequent it actually is.

Jym77 commented 1 year ago

A similar idea: checking that a form has a submit button (<input type="submit"> or <button type="submit">). This would secondary fail 1.3.1 / 3.2.2 under the assumption that 3.2.2 requires a way to confirm/send the data (i.e. change context as a result of user action), and 1.3.1 requires it to be coded as a submit button.