title: get the index of dynamic input array using in jquery validate plugin
body: <p>am trying to get the index of dynamic input tags</p>
  
  <ol>
  <li><p>html </p>
  
  <pre><code>&lt;input type="text" name="test[]" value='1'&gt;
  &lt;input type="text" name="test[]" value='2'&gt;
  &lt;input type="text" name="test[]" value='3'&gt;
  </code></pre></li>
  <li><p>validate.js</p>
  
  <pre><code>rules: {
      "test[]" : { 
          required : true
       }
  },
  messages: {
      "test[]" : {
          required : function ( r, i ) {
               return " the [index]st input required"; 
               **// i need to get the index of the current input(or select) tags**
          }}}
  </code></pre></li>
  </ol>