0

Why parsley don't validate each field (on losing focus for example) while I call $('#myForm').validate();?

Validation of field on losing focus starts to work only after I validate the whole form.

In javascript I set parsley to my form in that way:

formObject.parsley({trigger: 'change'});

No attributes are set to my form in html. No attributes except validation rule attributes are set to form fields. Setting data-parsley-trigger="change" to form fields don't help.

2 Answers 2

0

Parsley uses a threshold before which validation is triggered and by default its 3 characters.

See official documentation - http://parsleyjs.org/doc/index.html

Validation threshold #2.0
data-parsley-validation-threshold="10"
Used with trigger option above, for all key- events, do not validate until field have a certain number of characters. Default is 3

So can you please try entering 3+ characters and change focus to check if its performing the validation correctly?

1
  • Thanks for the answer! But no, it doesn't help(
    – Roman
    Feb 11, 2015 at 12:35
0

Late response...

data-parsley-trigger="focusout"

Additionally, the Trigger event supports these jQuery events.

Official documentation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.