Problem/Motivation
1. When client-side validation is disabled in webforms (which is required for accessible web forms)
2. And we submit the form when radios and checkboxes are required
3. Then the error at the top of the screen does not link to the error message in checkboxes or radios
Steps to reproduce
Proposed resolution
1. Update field.twig to allow messages to have attributes as well as message content
2. Update form element preprocessing to provide error message as well as attribute
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | Error messages are linking correctly.mp4 | 6.76 MB | danielgry |
Comments
Comment #2
fionamorrison23 commentedComment #3
richardgaunt commentedComment #5
richardgaunt commentedWe have PRs under review:
https://github.com/civictheme/uikit/pull/480
and
https://github.com/civictheme/monorepo-drupal/pull/1335
Comment #7
fionamorrison23 commentedComment #9
fionamorrison23 commentedComment #10
danielgry commentedVerified and tested on latest dev version
Testing Results:
1. Verified that when client-side validation is disabled, submitting a form with required radio or checkbox fields triggers error messages at the top of the form
2. Clicking on the error message now correctly moves focus to the relevant radio or checkbox field
3. Verified that form validation and error handling work consistently across all form elements without introducing new issues
Screen recording attached above.
Comment #11
danielgry commentedComment #12
fionamorrison23 commentedComment #13
richardgaunt commentedComment #14
richardgaunt commentedComment #15
fionamorrison23 commentedComment #16
fionamorrison23 commentedComment #17
fionamorrison23 commented