Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently there is no text that shows that a field has an error, adding a prefix with the error message would give context to no non sighted users. also link to this message from the error message on to of the page will give the user a way to skip to the errors.
This for easy error finding for those using screen readers and tabbing.
Comments
Comment #1
e2thex CreditAttribution: e2thex commentedAttach is a patch to form.inc
Comment #3
mlncn CreditAttribution: mlncn commentedYes i know there are follow links now but this deserves the attention of a bump :-)
New features have to go into Drupal 8 first but i hope a backport to Drupal 7 is possible if it cannot be done in a module (perhaps in Form Messages, in progress).
Comment #4
e2thex CreditAttribution: e2thex commentedI have attach a patch that can apply to 7.15
Comment #6
lmeurs CreditAttribution: lmeurs commentedFix patch from #4 for Drupal 7 (tested on 7.43) so the prefix does not overwrite a possibly existing prefix + small code cleanup.
Comment #7
lmeurs CreditAttribution: lmeurs commentedSorry, wrong file, new file attached.
Comment #8
lmeurs CreditAttribution: lmeurs commentedUpdated the patch to check if
#prefix
already exists and added support for query string parameters.Comment #14
robpowellSo I don't see this getting patched in d8 since the adoption of html 5 and aria support, 1174938. There was an attempt to backport that work to d7, 2984256 but is postponed until the regression which was introduced in 1174938 is resolved, 1797438. Unfortunately, this can be postponed till d9, so where does that leave us?
What this patch does is it makes the error messages link to the error fields. However when tabbing to the fields without using the link, there is no notification that the field has an error. In other words, a user using assistive technologies will not be alerted a specific field has an error as they tab through them. I believe this is one of the great short comings aria tags were supposed to solve. Since we don't have that option, I am going to suggest this gets RTBC.
Another possible path forward is using the https://www.drupal.org/project/clientside_validation module which has some support for aria based off this issue, 2940195
I attached a recording of running mac's voiceover with the patch installed.
Comment #15
robpowell