HenrikJoreteg / Happy.js

$('form').isHappy() – Lightweight, extensible form validation plugin for jQuery/Zepto.js
http://projects.joreteg.com/Happy.js/
MIT License
412 stars 123 forks source link

testValid() Error Check #15

Closed aarr0n closed 9 years ago

aarr0n commented 13 years ago

If a field is required but empty and has already been earmarked as unhappy, it seems strange to then remove the error message on blur if the field if its still empty.

This : if (required === true && val.length === 0) {

..seems to operate better than: if (submit === true && required === true && val.length === 0) {

Curious what others thought...

wraithgar commented 10 years ago

The solution to this would most likely include only removing the error if the field changed between the error and last blur, because the required is just one of many tests that can fail in a given input.

btpoe commented 9 years ago

As of 439ddb2 error messages will persist until the field is valid.