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:-  

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image