Q:

Is checkbox validation with validate.js library broken?

I need to add client-side form validation to an HTML5 form. I don't want to hack my own solution and I'm not using Angular. 
Since I'm using HTML5, the pattern and required attributes combined cover basic validation.
However, where custom validation is needed, for example, requiring a specific combination of checkboxes are ticked - I need something more.
A quick web search took me to The 10 Best JavaScript Libraries for Form Validation and Formatting.
I tested out Validate.js and hit a problem when validating checkboxes.  Validate.js binds to specific form elements by name, e.g.
var validator = new FormValidator('example_form', [{
    name: 'req',
    rules: 'required'
});

The corresponding HTML form:
<form name="example_form">
<input name="req" />
</form>

I decided to apply this to a group of checkboxes AND implement my own custom rule (documented on Validate.js):
 <form name="example_form">
    <input type="checkbox" name="test" value="a">
    <input type="checkbox" name="test" value="b">
    <input type="checkbox" name="test" value="c">
</form>

Firstly, the Validator configuration object adding my custom rule:
var validator = new FormValidator('example_form', [{
    name: 'test',
    rules: 'callback_my_rule'
});

...notice the required rule (provided out-of-the-box) is gone, and has been replaced by my own rule callback_my_rule. Next I defined my_rule (as per the documentation, the callback_ prefix is dropped):
validator.registerCallback('my_rule', function(value) {
    var atLeastOne = ($('[name="test"]:checked').length > 0);
    return atLeastOne;
});

A return value of False means validation failed, whereas True is valid.
The problem is, if no checkboxes are ticked, my custom validation function, my_rule, is never called.  Only when I tick a checkbox is the function called. It seems a unintuitive to only call custom validation functions when a checkbox is ticked. 
The Validate.js documentation provides an example form with a checkbox, however, the checkbox validation function is omitted from the sample code: 
However, the example form does validate the checkbox, digging around the source of Validate.js documentation, I see the checkbox uses the out-of-the-box required rule: 
Questions

Has anyone got Validate.js working with checkboxes and custom
validation functions?
Is there a better library for custom form
validation?

A:

I have tested Jquery Validation Plugin and works like a charm with checkbox!
DEMO LINK http://jsfiddle.net/K6Wvk/
   $(document).ready(function () {

        $('#formid').validate({ // initialize the plugin
            rules: {
                'inputname': {
                    required: true,
                    maxlength: 2
                }
            },
            messages: {
                'inputname': {
                    required: "You must check at least 1 box",
                    maxlength: "Check no more than {0} boxes"
                }
            }
        });

    });

