title: Creating rules efficiently for large forms
body: <p>I'm using the <a href="http://docs.jquery.com/Plugins/Validation/" rel="nofollow noreferrer">jQuery validate plugin</a> to validate a form with a lot of fields:</p>
  
  <pre><code>&lt;td&gt;&lt;input name="first_name0"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input name="last_name0"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input name="age0"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input name="first_name1"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input name="last_name1"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input name="age1"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input name="first_name2"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input name="last_name2"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input name="age2"&gt;&lt;/td&gt;
  ...
  &lt;td&gt;&lt;input name="first_name200"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input name="last_name200"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input name="age200"&gt;&lt;/td&gt;
  </code></pre>
  
  <p>What's the best way to add validation rules to all of the identical fields? Currently I'm adding rules like this, however it's very slow after 100 rows.</p>
  
  <pre><code>$("input[name*=age]").each(function(i) {
      $(this).rules("add", {
          digits: true
      });
  });
  
  $("input[name*=first_name], input[name*=last_name]").each(function(i) {
      $(this).rules("add", {
          digits: true
      });
  });
  </code></pre>