pancake
pancake

Reputation: 63

Validate fields in form before submit in Parsley 2.9.1

Is any posibility to validate inputs before click submit button in form?

E.g.: this form http://parsleyjs.org/doc/examples/customvalidator.html If you enter values to this form it doesn't check validation. But if you click submit button it checks values and now it dynamically checks entered values in fields in real time.

My goal is dynamically checking before I click submit button. How make validation without submit form?

Upvotes: 0

Views: 181

Answers (1)

Inna Zhurba
Inna Zhurba

Reputation: 106

Most likely I'm too late with my answer, but maybe it'll help somebody.

To trigger validation, you can set data-parsley-trigger attribute to each field. For example:

data-parsley-trigger="focusout"

See Parsley documentation for more detail and supported event.

Upvotes: 0

Related Questions