There are two solutions that come to mind:
1) Set the dependency for the required method:
{
firstName: {
required: function() { return !$('#lastName').val(); }
},
lastName: {
required: function() { return !$('#firstName').val(); }
}
}
2) Create a custom method using addMethod() which will do both
validations internally.
On May 9, 12:26 pm, TheDudeAbides <[EMAIL PROTECTED]> wrote:
> Hello Everyone,
>
> I've done some searching and am unable to find information on using an
> OR operator in the JQuery Validator plugin.
>
> I have two fields (for sake of argument) and before the form is valid
> at least one field must be filled in. They are nameFirst and nameLast.
>
> There may be a simple answer to this but I am just lost. I am
> competent enough with the Validator plugin to setup comparison rules,
> length rules, etc. just haven't been able find any OR operator
> information yet.
>
> Any help is greatly appreciated! Thanks!
>
> Jimmy