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

Understanding 3.3.1: Error Identification slightly unfocused/mixes up various concepts #977

Closed
patrickhlauke opened this issue Nov 28, 2019 · 13 comments · Fixed by #1651
Closed

Comments

@patrickhlauke
Copy link
Member

https://www.w3.org/WAI/WCAG21/Understanding/error-identification.html seems to cover various different ideas, but in the end still makes it quite unclear what it's really asking/requiring.

one common interpretation of this SC is that if there's an error, you need to have a textual error message next to the relevant form field that is in error. so, before/after/next to an erroneous form field, have actual text that explains that there's an error.

however, at the start of the intent section, it reads

Screen reader users, for example, will not know there was an error until they encounter one of the indicators. They may abandon the form altogether before encountering the error indicator, thinking that the page simply is not functional.

this would also be true for a textual indicator next to each invalid/erroneous form field, i assume? so is the requirement that there be a further error message/text at the start of the form, to say generically that there were errors? like a separate boxout that lists any errors, before the form? and not having that, and instead showing textual errors in context next to each form control, would fail this?

under benefits, it lists

This Success Criterion may help people with cognitive, language, and learning disabilities who have difficulty understanding the meaning represented by icons and other visual cues.

so, the use of just icons is not sufficient, it needs to be text. Is the use of icons (or color, or something non-textual) what is meant by "indicating the fields" here? or does "indicating the fields" also mean "even if the indication happened in text, next to the field"

In the case of an unsuccessful form submission, re-displaying the form and indicating the fields in error is insufficient for some users to perceive that an error has occurred.

@patrickhlauke
Copy link
Member Author

apart from possibly a bit of a rewording/focusing of the understanding, this could also really do with a few good representative examples (in case there are multiple scenarios here that are deemend appropriate, like a form with a list of errors at the start, and form fields then just identified with an icon/color; and, if acceptable as a solution, a form where each form field that is in error has an inline/contextual text-based error message showing, but NO list of errors at the start; etc)

@patrickhlauke
Copy link
Member Author

patrickhlauke commented Nov 28, 2019

to clarify the question, here's an example of what i mean by "in context" text-based error messages. a user tries to register an account and leaves out fields. fields are denoted both with an icon AND with text adjacent to the relevant form field, indicating there's an error with a particular field. there is no overarching "there were errors" / "here's a list of errors" or similar type separate listing/notification.

screenshot of an account registration form - all fields were left blank, so all required fields show an error below the input in text

if this is deemed acceptable (which has been my interpretation until now), then how does that square against this part of the intent

Screen reader users, for example, will not know there was an error until they encounter one of the indicators. They may abandon the form altogether before encountering the error indicator, thinking that the page simply is not functional.

because screen reader users will also not know there was an error until they encounter the text-based indicators (unless we don't include the text-based errors as "indicators" - but even then, they wouldn't know there were errors until they encountered the text-based error descriptions)

and, to address the specific "SR users don't know that there was an error when hitting submit", isn't the solution more about moving focus, firing a status message, or similar? not really directly related to text-based error descriptions?

@patrickhlauke
Copy link
Member Author

looking over one of the techniques (https://www.w3.org/WAI/WCAG21/Techniques/general/G83) there's a suggestion:

Another approach, using server-side validation, is to re-display the form (including any previously entered data), with either a text description at the location of the omitted mandatory field, or a text description that identifies the omitted mandatory fields.

leaving aside that this can also be done client-side, this seems to suggest that having "inline" text-based errors is fine. but again, that would go against the stated scenario of SR users missing these errors until they encounter them again.

@mraccess77
Copy link

From reading the sufficient techniques my understanding is that this can be met by a list at the top of the form or with inline error messages, or with an alert dialog. Linking the messages at the top with the fields is only advisory but best practice.

@patrickhlauke
Copy link
Member Author

patrickhlauke commented Dec 2, 2019

so the too long;didn't read is the basic "there needs to be some error indication/notification/list/description that uses text - not just image-based indicators (like a warning triangle, red X, or similar) even if they have appropriate alternative non-visible text"?

and everything else (the idea that having an overarching error message, or even a list of errors, at the start of the form; or somehow firing an altert/moving focus back to the start of the form/to the first erroneous form field) that's mentioned later on/interspersed in the understanding doc is just additional optional nice-to-have stuff?

@mraccess77
Copy link

@patrickhlauke I think icons could be used if they had alt text and didn't rely on color and the icon communicated the field in error. The challenge is when combined with error suggestions I may be difficult to provide both error identification and suggest as icons alone.

@patrickhlauke
Copy link
Member Author

I think icons could be used if they had alt text

That isn't my reading of this SC ... I'm not sure we claim that images with alt count as "described to the user in text"

and didn't rely on color

well that's a 1.4.1 use of color issue, related but not pertinent here

@JAWS-test
Copy link

I find SC 3.1.1 + Understanding too vague to pinpoint what is required here. Another problem is that there are currently no Failures. I think the quoted screen reader section ("Screen reader users, for example, will not know there was an error ") could be removed because it's now covered by SC 4.1.3.
Then a description in text form at the field or elsewhere would certainly be sufficient. If elsewhere, it would certainly be necessary to name the faulty fields.
The question is, if an error message has to be linked to the field (e.g. with aria-describedby) or if it falls under 1.3.1 or if this is not required ...?

@alastc
Copy link
Contributor

alastc commented Dec 6, 2019

I agree with the theme that error messages need to be in text, and you have options about how that is done.

With clients, I try to pin down whether it is a 'traditional' form that you submit and then get the errors, or is it a dynamic form which displays errors as you go along.

The 'vagueness' is necessary (unless we make it very long) as there are diffrent approaches depending on how the form works. E.g. if you submit the form and start at the top of the page then the top-of-page errors works well (with some indicator next to the input as well). However, if it is more dynamic, then by the input is the better option, perhaps with a message prior to the submit button.

If someone would like to add some examples or do an update, please assign this to yourself and create a doc or PR.

@mraccess77
Copy link

I'd like to come to a consensus if only providing the errors in text at the top of the form without a text indication next to the field or link to the field is a violation. Making sure we are passing/failing consistently is important to trustworthiness of our industry.

@alastc
Copy link
Contributor

alastc commented Dec 6, 2019

providing the errors in text at the top of the form without a text indication next to the field or link to the field is a violation

I wouldn't draw that conclusion from the SC text as written, and there are circumstances where a text error mesage at the top might be more useful. At the moment we fail for lack of a text-error message, but it could be at the top or next to the input.
If a form is dynamically adding error messages at the top (away from the focus) I'd start bringing up Status Messages, but generally advise that the solution for dynamically added error messages is to put them after the input, with a message prior to submission.

@patrickhlauke
Copy link
Member Author

Coming back to this (revisiting some of my long-open issues), are we roughly in agreement that this sentence in the intent is just making matters more confusing?

Screen reader users, for example, will not know there was an error until they encounter one of the indicators. They may abandon the form altogether before encountering the error indicator, thinking that the page simply is not functional.

as this implies that there needs to be extra stuff, like an alert dialog, status notification, list of errors or a message that "there were errors" or similar, and that this goes beyond what the requirement of the SC itself is? it's a best practice perhaps, but not core to the ask of the SC?

@patrickhlauke
Copy link
Member Author

made a first stab at a rewording/refocusing of the understanding document based on what i believe is mostly agreement in this discussion #1651

mbgower added a commit that referenced this issue May 14, 2024
* remove the misleading statement about screen reader users needing to
know that an error occurred before hitting one of the indicators/fields.
this implicitly suggests that the intent is for an error message/list to
be shown to (screen reader) users before the actual form, which is not
in fact the intention nor the requirement of this SC
* tweak the benefit for users with cognitive/language/learning
disabilities
* refocus on the benefit to ALL users, not just screen reader users
* ~add allowance for situations where an error indication is already
self-explanatory/obvious from context (e.g. a form where fields have
already explicitly been identified as mandatory/required - not necessary
for compliance to now ALSO explicitly say "as we already told you, this
field is mandatory")~ [potentially removed by mbgower suggestion]

Closes #977

---------

Co-authored-by: Alastair Campbell <[email protected]>
Co-authored-by: Mike Gower <[email protected]>
Co-authored-by: Wilco Fiers <[email protected]>
Co-authored-by: Mike Gower <[email protected]>
fstrr pushed a commit that referenced this issue May 28, 2024
* remove the misleading statement about screen reader users needing to
know that an error occurred before hitting one of the indicators/fields.
this implicitly suggests that the intent is for an error message/list to
be shown to (screen reader) users before the actual form, which is not
in fact the intention nor the requirement of this SC
* tweak the benefit for users with cognitive/language/learning
disabilities
* refocus on the benefit to ALL users, not just screen reader users
* ~add allowance for situations where an error indication is already
self-explanatory/obvious from context (e.g. a form where fields have
already explicitly been identified as mandatory/required - not necessary
for compliance to now ALSO explicitly say "as we already told you, this
field is mandatory")~ [potentially removed by mbgower suggestion]

Closes #977

---------

Co-authored-by: Alastair Campbell <[email protected]>
Co-authored-by: Mike Gower <[email protected]>
Co-authored-by: Wilco Fiers <[email protected]>
Co-authored-by: Mike Gower <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants