I am running into a problem with jQuery Validation and need to ignore some fields.
I need to ignore hidden fields and array of input boxes using validation plugin.
Below is html code.
<form id="transport-form">
<input type="text" name="qty[]" id="qty1">
<input type="text" name="qty[]" id="qty2" style="display:none" >
<input type="text" name="qty[]" id="qty3">
<input type="text" name="qty[]" id="qty4">
<input type="submit value="submit">
</form>
and jquery code is below
jQuery("#transport-form").validate({
rules: {
'qty[]': {
required: true,
ignore: '[],:hidden'
}
},
});
I need to ignore [] because everytime i click submit it is validating only the first value. rest all the values of same name are not validated.
But i want ignore also hidden input (qty2) Please help.