title: Using jquery validate with multiple fields of the same name
body: <p>I am trying to get jquery validate to work on multiple fields.  Reason being I have dynamically generated fields added and they are simply a list of phone numbers from none to as many as required.  A button adds another number.  </p>
  
  <p>So I thought I'd put together a basic example and followed the concept from the accepted answer in the following link:</p>
  
  <p><a href="https://stackoverflow.com/questions/931687/using-jquery-validate-plugin-to-validate-multiple-form-fields-with-identical-name">Using JQuery Validate Plugin to validate multiple form fields with identical names</a></p>
  
  <p>However, it's not doing anything useful.  Why is it not working?</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
                      "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/validate/lib/jquery.delegate.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js"&gt;&lt;/script&gt;
  
  
  &lt;script&gt;
    $("#submit").click(function(){
      $("field").each(function(){
        $(this).rules("add", {
          required: true,
          email: true,
          messages: {
            required: "Specify a valid email"
          }
        });   
      })
    });
  
  
    $(document).ready(function(){
      $("#myform").validate();
    });
  &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;form id="myform"&gt;
    &lt;label for="field"&gt;Required, email: &lt;/label&gt;
    &lt;input class="left" id="field" name="field" /&gt;
    &lt;input class="left" id="field" name="field" /&gt;
    &lt;input class="left" id="field" name="field" /&gt;
    &lt;input class="left" id="field" name="field" /&gt;
    &lt;br/&gt;
    &lt;input type="submit" value="Validate!" id="submit" name="submit" /&gt;
  &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>