How do I tell the parsley-Instance to exclude not visible form elements?
I found this in the Documentation:
data-parsley-excluded="input[type=button], input[type=submit], input[type=reset], input[type=hidden], [disabled], :hidden"
But I dont now where to set this Option? How can I parse this option to the Constructor?
Further Info: I am binding parsley to my form with jQuery("#formid").parsley();
Thanks a lot. Greets
Either do:
jQuery("#formid").parsley({ excluded: "input[type=button], input[type=submit], input[type=reset], input[type=hidden], [disabled], :hidden" });
Or
window.ParsleyConfig = { excluded: "input[type=button], input[type=submit], input[type=reset], input[type=hidden], [disabled], :hidden" };
<script src="parsley.js"></script>
(see http://parsleyjs.org/doc/index.html#psly-usage-global-configuration)
To disable globally, I added this to the same js page where I set up custom validators, ie:
window.Parsley.options.excluded = "input[type=button], input[type=submit], input[type=reset], input[type=hidden], [disabled], :hidden" ;
window.Parsley.addValidator('noemoji', {
requirementType: 'boolean',
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With