guillaumepotier / Parsley.js

Validate your forms, frontend, without writing a single line of javascript
http://parsleyjs.org
MIT License
9.05k stars 1.32k forks source link

Enhance error handling accessibility #640

Open gu-stav opened 10 years ago

gu-stav commented 10 years ago

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

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.

guillaumepotier commented 10 years ago

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.

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

gu-stav commented 10 years ago

Hi, I don't agree, that accessibility should be something optional, but I understand your point.

Anyway - I'll go the way with the plugin. I haven't seen any plugin architecture yet, so I think it's basically using the events/ monkey patches to hook in? I'll try to figure out next week, if everything is possible with this approach and refer to you.

guillaumepotier commented 10 years ago

Plugin examples here: https://github.com/guillaumepotier/Parsley.js/tree/master/src/extra/plugin Useful if you need to define core parsley methods accessible in every .parsley() or to override other things. But I thing in your case, mostly, you'll have to use listeners that way:

$.listen('parsley:form:init', function (parsleyFormInstance) {});
$.listen('parsley:field:init', function (parsleyFieldInstance) {});
$.listen('parsley:field:validated', function (parsleyFieldInstance) {});
$.listen('parsley:form:validated', function (parsleyFormInstance) {});

Like it is done in ParsleyUI.

Best

philgyford commented 9 years ago

Does anyone know if any progress was made on this? I'm using Parsley for a project at the moment but we need it to be a lot more accessible.

gu-stav commented 9 years ago

@philgyford Not yet - since the effort to extend the library was too big for the project, the company decided for another framework. If you like we could work together in out spare time on that - I believe it's an important issue ...

philgyford commented 9 years ago

It is. Unfortunately I don't have the time on this project to devote to it (we're in a "quick-n-dirty" stage) so I'll have to leave it. I suspect that in future we'll switch to doing JS validation a different way, so that we sync up our back- and front-end validation a bit better, but also have the ability to add the required accessibility features.

marcandre commented 9 years ago

This looks like a great feature to add. Maybe I can help?

juliemoynat commented 7 years ago

Hi,

Instead of aria-labelledby attribute on the field, I prefer aria-describedby because aria-labelledby will replace the label tag. But, if we put both label ID and error ID in aria-labelledby attribute, it will work. Example: `

`

Shelob9 commented 7 years ago

I am working on creating a script to fix accessibility problems in parsely and will separate it out a package so it can be npm installed. See: https://github.com/CalderaWP/Caldera-Forms/issues/1501

marcandre commented 7 years ago

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

cryptiklemur commented 5 years ago

For what its worth @guillaumepotier

Not everyone want to be accessibility standards compliant

Everyone is required to be ADA compliant (in the United States at least).

LukaszJaro commented 5 years ago

It's law in Canada as well.

Accessibility laws Ontario has laws to improve accessibility for people with disabilities. Learn about the standards you need to follow and reporting deadlines for complying with accessibility requirements.