title: Custom rules using Jquery Validate plugin
body: <p>I've read all of the Jquery Validate documentation but I'm still not clear on how to have my own custom rules for validating inputs.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;form id="myForm"&gt;
     &lt;input type="text" name="firstName" class="required" /&gt;
     &lt;input type="text" name="lastName" class="required" /&gt;
     &lt;input type="text" name="phone" class="phone" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>JQuery/Javascript</strong></p>
  
  <pre><code>$("#myForm").validate({
     rules: {
        // what do I put here so that an input with class phone is validated?
     },
     messages: {
        // what do I put here so that this message is displayed if .phone is invalid?
     }
  });
  </code></pre>
  
  <p>From what I've read its possible to build my own rule so that phone number is not only required but its also exactly 10 digits and if it isn't I can specify the message to show.  </p>
  
  <p>The JS above is what I've tried essentially straight from the documentation but it doesn't work.  The field is never validated and the message is never displayed.</p>
  
  <p>Any help is appreciated</p>