question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enhance error handling accessibility

See original GitHub issue

First of all - thanks for creating this amazing library. I’m currently doing research on form validation frameworks, since I have to decide which one to use in the near future for a big project. Therefore I have respect quite strict accessibility rules. I started to add basic aria roles/states here: e412198

TODO

  • Add role="alert" attribute to fields with errors
  • Add aria-invalid attribute to fields with errors
  • Add aria-labelledby="#ID" with reference to elements id, containing the error message. Therefore every error message-item should have it’s own id.
  • Extend multiple validation-fields to use fieldsets as wrapper with aria-required, aria-invalid attributes
  • Create error summary (above submit button) with list of links (containing anchors to the error fields in href) and errormessages (Example: error summary). This should have an option to enable/disable in the end.

Does somebody already work on that? Is that something, which you would like to integrate into the project? Maybe you could also give me some hints, where to add what (mainly the id-stuff for error messages), since I started today to read the code.

Cheers.

Issue Analytics

  • State:open
  • Created 9 years ago
  • Reactions:1
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
marcandrecommented, Apr 21, 2017

Unless it involves a lot of code, it would be even better if it was integrated in parsley itself.

5reactions
guillaumepotiercommented, May 16, 2014

Hi there,

Thanks for your interest in Parsley.

What you want to achieve is great. But it should not alter the existing Parsley code. Not everyone want to be accessibility standards compliant, that should be a separate Parsley plugin.

  • Add role=“alert” attribute to fields with errors => should be in window.ParsleyConfig configuration
  • Add aria-invalid attribute to fields with errors => same here
  • Add aria-labelledby=“#ID” with reference to elements id, containing the error message. Therefore every error message-item should have it’s own id. => maybe custom code triggered on field:init event
  • Extend multiple validation-fields to use fieldsets as wrapper with aria-required, aria-invalid attributes => not sure to understand
  • Create error summary (above submit button) with list of links (containing anchors to the error fields in href) and errormessages (Example: error summary). This should have an option to enable/disable in the end. => custom work binded on form:validate

I’m not sure if you are very familiar with Parsley code, configuration and extension, but you should definately do this, but in a plugin mindset, not directly in the code like you are doing on your repo, because I won’t ship it that way 😃

What do you think ?

Best

Read more comments on GitHub >

github_iconTop Results From Across the Web

User Notification | Web Accessibility Initiative (WAI) | W3C
Notifications have to be concise and clear. In particular, error messages should be easy to understand and should provide simple instructions on how...
Read more >
How to make inline error messages accessible - Hidde's blog
In summary. In this post, I have discussed three ideas to improve the accessibility of dynamically added error messages: identify a field as...
Read more >
How to Provide Accessible Form Error Identification
Overview. This post covers the basics of providing accessible form error identification to users with disabilities. Accessible error identification in ...
Read more >
Accessibility Errors - W3Schools
An accessible form needs error messages that is perceivable and understandable for people who is color blind, who is blind or low vision,...
Read more >
Alert Users to Errors that Prevent Form Validation
One of the simplest ways to enhance forms accessibility is to help users avoid errors before the errors even occur. We can prevent...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found