title: Ensure at least one from a group of three checkboxes is checked using jQuery Validate
body: <p>I'm using the jQuery Validate plugin on a large form, and have been using the require_from_group method (<a href="https://stackoverflow.com/questions/14883017/using-jquery-validate-plugin-to-ensure-at-least-one-of-three-checkboxes-is-check">after posting previously</a>) to ensure at least one from a group of three checkboxes is checked.</p>
  
  <p>However, I've <a href="https://github.com/jzaefferer/jquery-validation/issues/412" rel="nofollow noreferrer">ran into an issue</a> with this where it stops other rules from working. I've applied a <a href="https://stackoverflow.com/questions/11070245/jquery-validator-group-how-to-use-it/13127475#13127475">suggested patch</a>, but that doesn't seem to work correctly either (as mentioned in the above GitHub issue).</p>
  
  <p>So I need to find another way to validate this group of three checkbox fields (note that I need to specifically target this group of three checkboes, as I have other checkbox fields on the form that don't require validating), but I'm not sure where to start with this now. I'm thinking I need to add some sort of custom rule into my jQuery validate code, but I'm not sure where to start with this now so would appreciate some advice, thanks.</p>
  
  <p>Here's my starting HTML (stripped to bare essentials for this question):</p>
  
  <pre><code>&lt;form class="my_form" method="post" action="/" &gt;
  
    &lt;div&gt;&lt;ul class="form_errors"&gt;&lt;/ul&gt;&lt;/div&gt;
  
    &lt;label&gt;&lt;input class="my_checkbox_group" id="my_checkbox_1" name="my_checkbox_1[]" type="checkbox" value="Yes"&gt; My checkbox 1&lt;/label&gt;
    &lt;label&gt;&lt;input class="my_checkbox_group" id="my_checkbox_2" name="my_checkbox_2[]" type="checkbox" value="Yes"&gt; My checkbox 2&lt;/label&gt;
    &lt;label&gt;&lt;input class="my_checkbox_group" id="my_checkbox_3" name="my_checkbox_3[]" type="checkbox" value="Yes"&gt; My checkbox 3&lt;/label&gt;
  
    &lt;input type="submit" value="Submit" /&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>Here's my starting JS (this makes all three of the checkboxes mandatory, but I only want at least one from three to be checked):</p>
  
  <pre><code>$(".my_form").validate({
    errorLabelContainer: ".form_errors",
    wrapper: "li",
    rules: {
      'my_checkbox_1[]': { required: true },
      'my_checkbox_2[]': { required: true },
      'my_checkbox_3[]': { required: true }
    },
    messages: {
      'my_checkbox_1[]': "This field is required",
      'my_checkbox_2[]': "This field is required",
      'my_checkbox_3[]': "This field is required"
    }
  });
  </code></pre>
  
  <p><strong>Edit 1:</strong> Sorry, I should have added that the name attributes of each checkbox can't be the same. These names map to specific custom field names in the CMS, so if they were all the same, the values in the fields wouldn't be saved correctly when the form was submitted. This is also the reason why I never followed the second example on the <a href="http://jquery.bassistance.de/validate/demo/" rel="nofollow noreferrer">jQuery Validate demo page</a>.</p>