Validating the Telephone field in Adobe Forms using JavaScript

By Kalyan Balabhadrapatruni, YASH Technologies

 

In the Exit write the below JavaScript.  

if (this.rawValue != null)
{
var valid = "0123456789- ";
aphone = this.rawValue;
 for (var i=0; i < aphone.length; i++)
         {
         temp = "" + aphone.substring(i, i+1);
         if (valid.indexOf(temp) == "-1") 
         {
    xfa.host.messageBox("Please enter the number using only the characters 0-9");
    this.rawValue = null;
    aphone = null;
    xfa.host.setFocus(this);
         }
    }   
}
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