title: jQuery validation, put error message below groups of checkboxes and radio buttons
body: <p>I have a form that has a few groups of checkboxes and radio buttons. The error message for the radio buttons always shows up directly after the first radio button in the group. I was able to get the error messages to display below the groups of checkboxes. However, I'm not having any luck getting the same to happen for radio buttons. All of the name attributes for the radio and checkboxes are different (ugh). Here's the code I currently have...</p>
  
  <pre><code>jQuery("body.page-user-register input[type=checkbox]").addClass("certboxes");
  jQuery.validator.addMethod('certboxes', function (value) {
            return jQuery('.certboxes:checked').size() &gt; 0; }, 'Please check at least one     box.');
  var checkboxes = jQuery('.certboxes');
  var checkbox_names = jQuery.map(checkboxes, function(e,i) { return jQuery(e).attr("name")}).join(" ");
  
  
  groups: {checks: checkbox_names},
      errorPlacement: function(error, element) {
           if (element.attr("type") == "checkbox") {
             error.insertAfter(checkboxes.parent().last());
             }
           else {
             error.insertAfter(element); 
             }
  }
  </code></pre>