javascript - Attaching Parsley.js Validation Library to Form Takes Very Long -
i'm trying out parsley.js validation library, however, when attaching form (which has several thousand input fields ... has multiple lists checkboxes) parsley javascript runs minute goes through fields (even though i've excluded checkboxes):
<form id="form" data-parsley-validate data-parsley-excluded="input[type=checkbox]">
is there setting use fix problem since excluding checkboxes doesn't seem help. attach validation individual fields , not whole form? if though i'd have oversee form submission, etc. , manually trigger validation, correct?
what's best approach take in situation?
the issue parsley iterates through elements match input selector, wraps them in parsley object (which takes bit of time), , only then checks if should excluded. you've seen, quite slow when dealing many elements.
to outright ignore checkboxes, can manually override inputs
configuration option (either directly in javascript, or via data-parsley-inputs
). default inputs
input, textarea, select
, have make first 1 more restrictive:
<form id="form" data-parsley-validate data-parsley-inputs="input:not([type='checkbox']), textarea, select"> <!-- ... --> </form>
here's example fiddle: http://jsfiddle.net/tkt1dvq1/
Comments
Post a Comment