title: jQuery: Validate if one of many checkboxes is selected (different names, using the jQuery Validation Plugin)
body: <p>I have a form that has many checkboxes (too many for it to make sense to use their own rules), and I need to use the <a href="http://docs.jquery.com/Plugins/Validation" rel="nofollow noreferrer">jQuery Validation Plugin</a> to make sure at least one of them is selected.  They all have different names, so most of the solutions I've found so far by Googling don't work for me.</p>
  
  <p>However, I came across <a href="http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Jquery/Q_24282111.html" rel="nofollow noreferrer">this</a> post, which I tweaked a bit to make this extension method:</p>
  
  <pre><code>// method for checking out checkboxes for the form validation
  $.validator.methods.checkboxes_checked = function(value,element,param) {
     return ($('#signup #checkboxes input[type=checkbox]:checked').length &gt; 0);
  }
  </code></pre>
  
  <p>... which returns true or false depending if there are any of the checkboxes selected.  I don't want to use the method from the above post verbatim, since that would require making separate rules for each checkbox, and as I have a lot of them (20+), that doesn't make much sense to me.</p>
  
  <p>My only issue is that I don't know how to wire this into my validation call, since I don't have a "single" element on the page to tie it too (as in, all my other validation rules are tied to a specific single element, whereas my extension method above would be--in essence--tied to 20+ elements).  Here's how my validation call looks now:</p>
  
  <pre><code>// validate the form
  $('#signup').validate({
     rules: {
        'bedrooms': { required: true },
        'maxrent': { required: true },
        'term': { required: true },
        'movedate': { required: true },
        'firstname': { required: true, minlength: 2 },
        'lastname': { required: true, minlength: 1, maxlength: 1 },
        'email': { required: true, email: true },
        'day_telephone': { required: true, digits: true, minlength: 10, maxlength: 10 }
     },
     errorPlacement: function(error, element) { error.css('display','none'); },
     highlight: function(element, errorClass) { 
        $(element).fadeOut(function() { $(element).fadeIn(); });
        $('label[for='+$(element).attr('name')+']').css('color','red');
     },
     unhighlight: function(element, errorClass) { $('label[for='+$(element).attr('name')+']').css('color','black'); },
     onkeyup: false
  });
  </code></pre>
  
  <p>I want, basically, for the form itself to check (using the jQuery Validation Plugin) if my extension method returns true before submitting.  How can I add this in?</p>