Hi, in the form i am building there are telephone and email fields. If you fill the telephone field you needn't fill the email field and viceversa. But one of them must be required. How can I do this?
Thanks!
Thanks!
function eitherOr(el){
el.validation.erase('required');
if ( !$('phone').value && !$('email').value ) {
el.validation.push("required");
el.errors.push("Enter either phone or email");
return false;
} else {
return true;
}
}
and change phone and email to match the ids of the two inputs.