title: JQuery validate plugin - can't validate classes
body: <p>I'm trying to use the jQuery validate plugin to validate classes instead of ID's. Despite the many threads which seem close to answering this issue - I can't get any of them to work. I simply have a form that has a lot of dynamically generated repeating form fields, so naturally I can't add rules for the ID's because there's no knowing how many of them there will be. So, instead, I would like to just target the class on the input field.</p>
  
  <pre><code>&lt;input type="text" id="name1" class="fileName" /&gt;
  &lt;input type="text" id="name2" class="fileName" /&gt;
  &lt;input type="text" id="name3" class="fileName" /&gt;
  &lt;input type="text" id="name4" class="fileName" /&gt;
  </code></pre>
  
  <p>How do I target 'fileName' class? I've tried this:</p>
  
  <pre><code>$(document).ready(function(){
      $.validator.addClassRules({
          fileName:{
          required: true
      }
      });
      $("#myForm").validate();
  });
  </code></pre>
  
  <p>But this does not work at all :(</p>
  
  <p>Any ideas? Anyone?</p>