Adding Syntax Validation for Email Field
This validation ensures that a valid value is specified for the
Email field.
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 type the following:
-
Click the radio button
On Form Submit.
-
Type the following JavaScript code in the
Script text area:
var email = this.getValue();
if(email != null && email != "")
{
//Match format xxx@xxx.xxx
var match = RegExp("(.)+@(.)+\\.(.)+").test(email);
match;
}
else
{
true;
}
-
Type the following text in the
Message area:
Email must be of the form xxx@xxx.xxx.
-
Click
Finish.
Copyright © Cloud Software Group, Inc. All rights reserved.