title: jQuery Validation Plugin: Validating Checkboxes with Different Names
body: <p>I have a set of 4 checkboxes, all with different names, and require that at least 1 is checked.  </p>
  
  <p>I have set the class on all of them to 'require-one'.  </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="scripts/lib/jquery.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="scripts/jquery.validate.js" type="text/javascript"&gt;&lt;/script&gt;
  
  &lt;script language="JavaScript" type="text/javascript"&gt;
   $(document).ready(function(){
      $("#itemForm").validate({
  
  rules: { 
      check1: {  
          required : {  
              depends: function(element) {  
                  $('.require-one:checked').size() == 0; 
              }  
          } 
      } 
  }
      });
    });
  &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form name="itemForm" id="itemForm" method="post"&gt;
  &lt;input type="checkbox" name="check1" id="check1" class="require-one" value="1" /&gt;
  &lt;input type="checkbox" name="check2" id="check2" class="require-one" value="2" /&gt;
  &lt;input type="text" class="required" /&gt;
  &lt;input type="submit" /&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>If you put in <code>'return'</code> before the <code>$('.require-one:checked').size() == 0;</code> However, now my problem is the error message will only disappear if Checkbox #1 is selected.  If Checkbox #2 is selected it will not disappear, but will submit.  How do I remove the error if any of the checkboxes are checked?</p>
  
  <pre><code>rules: { 
      'nameOfAnyCheckbox': {  
          required : {  
              depends: function(element) {  
                return $('.require-one:checked').size() == 0; 
              }  
          } 
      }
  </code></pre>