title: Validating array inputs using jquery validation plugin
body: <p>I have the following form. I am trying to validate the inputs using jquery validation plugin. I have tried some codes but its not working. When I click on the submit button it just goes to form's action.</p>
  
  <pre><code>&lt;form name="voucherform" action="something" method="post"&gt;
    &lt;input type="text" name="reg_number[]" value="" /&gt;
    &lt;input type="text" name="reg_number[]" value="" /&gt;
    &lt;input type="text" name="reg_number[]" value="" /&gt;
    &lt;input type="submit" name="submit" value="submit" /&gt;
  </code></pre>
  
  <p> </p>
  
  <p>Could you please show me how to validate the above form using jquery validation plugin?</p>
  
  <p>Thanks :)</p>
  
  <p>My Jquery code:</p>
  
  <pre><code> &lt;script type="text/javascript" src="&lt;?php echo base_url();?&gt;support/datepicker/js/jquery-1.7.2.min.js"&gt;&lt;/script&gt;
   &lt;script type="text/javascript" src="&lt;?php echo base_url();?&gt;support/js/jquery.validate.js"&gt;&lt;/script&gt;
  
   &lt;script&gt;
    $(document).ready(function() {
  
  // validate signup form on keyup and submit
  var validator = $("#voucherform").validate({
      showErrors: function(errorMap, errorList) {
          $(".errormsg").html($.map(errorList, function (el) {
              return el.message;
          }).join(", "));
      },
      wrapper: "span",
      rules: {
  
          reg_number[]: {
              required: true,
              minlength: 2,
              remote: {
                  url: '&lt;?php echo base_url();?&gt;sales/invoice_check', async: false,
                  type: 'post'
              },
  
          }
      },
      messages: {
  
          reg_number[]: {
              required: "Enter Reg Number",
              minlength: jQuery.format("Enter at least {0} characters"),
              remote: jQuery.format("{0} is already in use")
          },
      }
      });
      });
     &lt;/script&gt;
  </code></pre>