0

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.

Janka
  • 1,908
  • 5
  • 20
  • 41
  • Possible duplicate of [How to validate array of inputs using validate plugin jquery](http://stackoverflow.com/questions/24670447/how-to-validate-array-of-inputs-using-validate-plugin-jquery) – Clyde Lobo Nov 30 '16 at 13:42
  • That incomplete solution does not solve my problem. – Janka Nov 30 '16 at 13:46
  • my problem is: How to concatenate array [] and :hidden simultaneously into ignore properties? – Janka Nov 30 '16 at 13:48

0 Answers0