Validating the email field in Adobe Forms using JavaScript
By Kalyan Balabhadrapatruni, YASH Technologies
In
the Exit write the below JavaScript.
if ( this.rawValue != null && this.rawValue != "")
{
var r = new RegExp("^[a-zA-Z0-9_\\-\\.]+\\@[a-zA-Z0-9_\\-\\.]+\\.[a-zA-Z]{2,3}$");
var result = r.test(this.rawValue);
if (result == true)
true;
else
{
xfa.host.messageBox("Please enter valid email address.e.g. abc@yash.com");
this.rawValue = null;
xfa.host.setFocus(this);
false;
}
}
Output:-
|