Validating the URL field in Adobe Forms using JavaScript
By Kalyan Balabhadrapatruni, YASH Technologies
In
the Exit write the below JavaScript.
if (this.rawValue != null )
{
var tomatch = /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/
var result = tomatch.test(this.rawValue);
if ( result == true)
true;
else
{
xfa.host.messageBox("Please enter a valid URL eg: http://www.Yash.com");
this.rawValue = null;
xfa.host.setFocus(this);
false; // fail the validation.
}
}
Output:-
|