Thanks for the ref doc page, just now getting around to finishing..
this is what ended up working for me...

$('#register').validate({
        groups: {
                //group method only accepts form element names
                birthDate: "person.birthMonth person.birthYear person.birthDay",
                gradDate: "person.highSchoolGraduationMonth
person.highSchoolGraduationYear",
                prevRegDate: "previousTestMonth previousTestYear"
        },
        //default is label tag which created multiple labels for single form
element so I changed to span
        errorElement: "span",
        //assuming you have your input elements wrapped in a parent div
        errorPlacement: function(error, element) {
                 error.appendTo( element.parent() );
                }
});
//validator methods for each of the groups
$.validator.addMethod("birthDate", function() {
        return $('#birthDay,#birthMonth,#birthYear').val() == null;
});
$.validator.addMethod("gradDate", function() {
        return $('#graduationMonth,#graduationYear').val() == null;
});
$.validator.addMethod("prevRegDate", function() {
        return $('#previousTestMonth,#previousTestYear').val() == null;
});

hth, alan

On Nov 11, 3:54 pm, [EMAIL PROTECTED] wrote:
> That would be the groups option, I'm still trying to make it work, but here's 
> the documentation I've found:
>
>
>
> http://docs.jquery.com/Plugins/Validation/Reference#Validating_multiple_fields_with_one_method 
>
>
>
> I've got my rules and my groups option both in the validate javascript call.  
> If you figure out how to get groups option working with that setup, please 
> let me know :)
>
> -------- Original Message --------
> Subject: [jQuery] validate
> From: jalanbyers <[EMAIL PROTECTED]>
> Date: Tue, November 11, 2008 2:40 pm
> To: "jQuery (English)" <jquery-en@googlegroups.com>
> Hi,
> I am using the amazing validator plugin by Mr. Zaefferer.. I'm unable
> to find any documentation on using multiple fields within a single
> validation rule (e.g. adding a single validation to 3 social security
> number fields rather than validating each field separately and using a
> single errorContainer to be used for all 3.)
> Any advice would be greatly appreciated..
> Thanks!

Reply via email to