Parsley.js: Events Cheat Sheet

The API to listen to events:

$('#some-input').parsley().on('field:success', function() { // In here, `this` is the parlsey instance of #some-input });

Events List:

NameInstanceFired byDescription
form:init ParsleyFormnew Parsley()Triggered when a Form is bound for the first time.
form:validate ParsleyForm.validate()Triggered when a form validation is triggered, before its validation.
form:success ParsleyForm.validate()Triggered when a form validation is triggered, after its validation succeeds.
form:error ParsleyForm.validate()Triggered when a form validation is triggered, after its validation fails.
form:validated ParsleyForm.validate()Triggered when a form validation is triggered, after its validation finishes (with success or with errors).
form:submit ParsleyFormsubmit()Triggered when after a form validation succeeds and before the form is actually submitted.
Return `false` to interrupt submission.
field:init ParsleyFieldnew Parsley()Triggered when a Field is bound for the first time.
field:validate ParsleyField.validate()Triggered when a field validation is triggered, before its validation.
field:success ParsleyField.validate()Triggered when a field validation succeeds.
field:error ParsleyField.validate()Triggered when a field validation fails.
field:validated ParsleyField.validate()Triggered after a field is validated (with success or with errors).

Leave a Reply

Your email address will not be published. Required fields are marked *