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