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!
Hi Marizu,
This seems to be quite tricky but I got a validation that works. Add this to a Load JS action on the ON Load event
Then add validate['%eitherOr'] in the Class box of each input.
Bob
This seems to be quite tricky but I got a validation that works. Add this to a Load JS action on the ON Load event
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.Then add validate['%eitherOr'] in the Class box of each input.
Bob
This topic is locked and no more replies can be posted.