cferdinandi / validate

A lightweight form validation script.
MIT License
230 stars 39 forks source link

Textarea error message #61

Closed maciejcieslik closed 6 years ago

maciejcieslik commented 6 years ago

Test case: https://jsfiddle.net/yhqepa3x/1/

error message from textarea don't disappear when value is not empty anymore and error message is appended on every focus.

fabs2011 commented 6 years ago

You have empty spaces in your name attributes. I understand that it isn't forbidden but do you really need to? If you add the "required" validation rule to "Numer telefonu" for example, the plugin fails as it does with the textarea (named "txt#Wiadomość"), it doesn't like that "#". Use camelCase or underscores in your html code if you can or even better use "id" and write whatever you like in the "name" attribute, even empty spaces and the plugin works like a charm! See this for more details if you interested.

maciejcieslik commented 6 years ago

Spaces are for cms, so it just take name and instert it in a mail to admin, but i don't understand why validate names? Type should be validated and optionally a pattern. Validation shouldn't care about names as this can be sometimes really weird (in example on the backend name="lorem[ipsum][0]").

cferdinandi commented 6 years ago

This is a big irrespective of naming convention. The name can have spaces.

cferdinandi commented 6 years ago

The native API is a total pain to work with.

I just created a new form validation plugin, Bouncer, that's the same size as Validate.js and uses native form validation elements, but works a little differently under the hood.

I'm deprecating Validate.js today and replacing it with Bouncer.