title: Custom jQuery validation function not firing
body: <p>I'm trying to use a custom validation function to check if at least one check box is selected. But the validation function is not firing. What am I missing?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Index&lt;/title&gt;
      &lt;script type="text/javascript" src="../Scripts/jquery-1.8.0.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="../Scripts/jquery.validate.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          $(document).ready(function () {
              $.validator.addMethod("fruits", function(value, elem, params) {
                  if($(".fruits:checkbox:checked").length &gt; 0){
                      return true;
                  }else {
                      return false;
                  }
              },"pick at least one plz");​
  
              $("#form1").validate({
                  rules:{
                      fruits:{
                          fruits: true
                      }
                  },
                  submitHandler: function(form) {
                      alert("submitting...");
                      form.submit();
                  },
                  invalidHandler: function(form){
                      alert("invalid form");
                  }
              });
          });
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1"&gt;
      &lt;input type="checkbox" class="{fruits: true}" name="fruits" id="chkApple" value="1" /&gt;Apple&lt;br /&gt;
      &lt;input type="checkbox" class="fruits: true}" name="fruits" id="chkBanana" value="2" /&gt;Banana&lt;br /&gt;
      &lt;input type="submit" value="Submit" /&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>