This validation ensures that a value is specified for either the Email or Phone field. The user is not required to provide values for both in this application.
Procedure
Click the
Email field.
Click the
Validations tab on the control’s
Properties view.
Click the
Add New Validation button.
The
Define Validation dialog opens.
In the
Name field specify the following:
email_or_phone_required
Click the radio button
On Value Change.
Type the following JavaScript code in the
Script text area:
//Check one of email and phone fields are entered
if((f.CustPhone == null || f.CustPhone == "") &&
(f.CustEmail == null || f.CustEmail == "")){
false;
} else{
true;
}
Type the following text in the
Message area:
Either customer phone number or email address must be entered.