zhouzi / GentleForm

Accessible and user-friendly HTML5 form validation library.
http://codepen.io/Zhouzi/full/QbBzZp/
MIT License
36 stars 3 forks source link

FEATURE REQUEST: please add a wildcard/catchall to data-errors-when #11

Open badpenguin opened 6 years ago

badpenguin commented 6 years ago

I just need to display a single error message when there is any error without creating all the possibile DIVs with the exact error class. Is that possibile?

zhouzi commented 6 years ago

Thanks for the suggestion! 👍

Could you expand a bit on your use case? I cannot think of a situation where not being specific about an error would improve the user experience. I know properly handling form errors can become tedious but I'd like GentleForm to encourage developers to provide a better user experience.

You can also use the includes to declare the error messages once and reuse them as much as needed (see reusing messages).

badpenguin commented 6 years ago

Il 11/12/2017 16:25, Gabin Aureche ha scritto:

Thanks for the suggestion! 👍

Could you expand a bit on your use case? I cannot think of a situation where not being specific about an error would improve the user experience. I know properly handling form errors can become tedious but I'd like GentleForm to encourage developers to provide a better user experience.

The use case is when you use a single full error message like this: "The password is mandatory and must be at least 8 chars with 1 uppercase and 1 number". So this cover any case. Also in multilingual application, having multiple error message with different text for the same field is a pain :-)