简体   繁体   中英

Validate fields in form before submit in Parsley 2.9.1

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

Eg: 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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM