I'm guessing this is a bug.
Take this form:
<form method="post" id="myForm">
<input type="text" name="field1" value="" class="required" />
<input type="hidden" name="hiddeninput" value="" class="required" />
<input type="submit" value="Go">
</form>
With the following javascript, even though we tell Parsley to validate hidden fields, it does not work:
$("#myForm").parsley({
excluded: 'input[type=button], input[type=submit], input[type=reset]',
inputs: 'input, textarea, select, input[type=hidden], :hidden',
});
However, if you define this as a global configuration, it does work
window.ParsleyConfig = {
excluded: 'input[type=button], input[type=submit], input[type=reset]',
inputs: 'input, textarea, select, input[type=hidden], :hidden',
};
$("#myForm").parsley();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…