Exclude invisible inputs with parsley.js 2.x

How do I tell a parsley-instance instance to exclude invisible 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'm not right now, where to install this option? How can I parse this parameter to the constructor?

Additional info: I attach parsley to my form with jQuery("#formid").parsley();

Many thanks. Congratulated

+4
source share
1 answer

Or 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 )

+5
source

Source: https://habr.com/ru/post/1535376/


All Articles