Skip to content

Conversation

@detlevhfischer
Copy link
Contributor

@detlevhfischer detlevhfischer commented Jun 5, 2025

Addition of a section on native HTML error validation, addressing to some extent the issues #961 and #1773 and maybe other issues.
This is mainly to start / a first stab at updating this dated understanding text. Currently there are a couple of notes strewn in, one on rectification on user input, and another note saying that there can be different techniques to display the error in text, including rather dated techniques like Javascript alerts.

The pertinent question whether (and under what conditions) native HTML form validation can be deemed sufficient to meet 3.3.1 is not touched upon in the current understanding text. While it will be difficult to draw a definite line like "on forms with three fields or less native HTML validation can be considered sufficient", it seems necessary to address the disadvantages and maybe also the benefits of native HTML validation.

Other issues that remain to be worked into a revision are, for example, correcting the inclusion of ARIA Techniques as "sufficient" as noted in #4029, and possibly adding advice regarding the combination of available techniques (e.g., to warn against overdoing it with programmatic linking of inline error messages plus aria-live regions).

EDIT: preview link https://deploy-preview-4431--wcag2.netlify.app/understanding/error-identification (new section "Note on using native HTML form validation")

@netlify
Copy link

netlify bot commented Jun 5, 2025

Deploy Preview for wcag2 ready!

Name Link
🔨 Latest commit c30fc7e
🔍 Latest deploy log https://app.netlify.com/projects/wcag2/deploys/690a277183860100076ed9f4
😎 Deploy Preview https://deploy-preview-4431--wcag2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@patrickhlauke patrickhlauke self-assigned this Jul 11, 2025
@mbgower
Copy link
Contributor

mbgower commented Sep 5, 2025

@patrickhlauke to re-check.

Copy link
Member

@patrickhlauke patrickhlauke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest renaming the section, moving it after the two existing notes, and tweaking the language (as it's not just the required attribute that triggers these things).

may also be worth couching the description a bit more into "in most user agents" type language (though from testing, the statements here hold true for chrome, edge, firefox, safari, probably others, from my testing)

@patrickhlauke
Copy link
Member

@detlevhfischer let me know if you're happy for me to make some of my proposed more fundamental tweaks here for you, or if you want to do them yourself (don't want to just barge in and rewrite your PR without your approval)

@patrickhlauke patrickhlauke changed the title Update error-identification.html Add section on native browser form validation to 3.3.1 understanding Sep 7, 2025
@detlevhfischer
Copy link
Contributor Author

Very happy for you to step in!

@patrickhlauke
Copy link
Member

@detlevhfischer pushed some changes ... have a look and see if this still captures what you were trying to do

@mbgower
Copy link
Contributor

mbgower commented Sep 12, 2025

Note that "success criterion/criteria" is almost always lower case now. Please see our style guide

@patrickhlauke
Copy link
Member

Apologies @mbgower .... removed my over-eager "capitalise ALL THE SUCCESS CRITERION mentions" faux-pas. @adampage this is now clean and ready for review. for reference, when I checked that the behaviour described here actually happens, i tested in the following combinations: windows chrome, firefox, edge, with JAWS and NVDA; ios/safari/VO; android/chrome/talkback; macos/safari/VO

Copy link
Member

@adampage adampage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very helpful to have this documented. This is ready to go IMO! 🚀

@detlevhfischer
Copy link
Contributor Author

@patrickhlauke read through "Files changed", looks good to me!

@gundulaniemann
Copy link
Contributor

It does not become clear whether the method to use the user agent's ability leads to a conformant page. One hand it says: "While this meets the requirements of this Success Criterion, it should be noted that there are several disadvantages related to this approach", while further down it states that the error message might not show with enlarged text (which is a violation of text resizing), and further down it states that the user might need to resubmit while in the other sections of the understanding it clearly suggests that all errors should be displayed at once for convenient correction.

@gundulaniemann
Copy link
Contributor

To rephrase my last comment: I think the new text somehow contradicts itself concerning the point whether this approach leads to a conformant page or not.
Instead, it should be clearly stated whether it does.
In fact I think it doesn't.

@baldino-m
Copy link

I think that the browser native validation approach is not recommended, but if this violates another SC, it is still a pass for "Error identification". The only concern is about the back and forth with submissions-showing a single error-submit again-show another error, since the system is technically aware of all errors when the form is submitted the first time (and not showing all the messages for the identified errors), so it might represent a violation. However, since this is a native behaviour, we can discuss if this can be forgiven.

@TestPartners
Copy link

I think that the browser native validation approach is not recommended, but if this violates another SC, it is still a pass for "Error identification".

The problem with native validation in Chrome and Firefox is that the error message can disappear or become dissociated from the form control that is in error. It therefore fails SC 3.3.1 even if the page only contains one form control.

@patrickhlauke
Copy link
Member

The problem with native validation in Chrome and Firefox is that the error message can disappear

I don't think normatively it's required that error messages be persistent.

or become dissociated from the form control that is in error

Is there an example of this? I've tried to replicate this with various zoom levels, scrolling around, etc, but it seems solid enough from my cursory testing. Is it an issue on mobile/small screen browsers, more than large screen/desktop ones?

@TestPartners
Copy link

In Chrome, the error message disappears if you scroll the page such that the error message moves out of the viewport. The error message does not reappear when you scroll the page back to the original position, so there is no indication there was ever an error message.

In Firefox, the error message remains in the same place in the viewport when the page is scrolled, so the visual relationship between the form control and the error message is lost. If the page contains multiple form controls, it is impossible to know which one the error message is associated with.

I regard both behaviours as being non-conformant.

@patrickhlauke
Copy link
Member

ah, somehow missed the firefox behaviour. that's certainly a bug with firefox (which would impact "accessibility support" of that technique while it's not fixed)

@bruce-usab
Copy link
Contributor

Discussed on backlog call 10/24. TF members on call concur that only concern is for bug in FireFox. Moved to Ready for Review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants