Hi Everyone,
I am trying to erase the data in a textfield when validation fails. Currently, Validation works perfectly but after the message box, the incorrect data stays in the textfield, which defeats the entire purpose. I tried to use javascript to fix the issue with regular expressions but it doesnt seem to be working. The following is the code I am using.
phoneRegex = /^\(\d\d\d\) \d\d\d-\d\d\d\d$/;
if( phone.match( phoneRegex ) ) {
xfa.host.messageBox( "Please enter a valid phone number" );
this.rawValue = null;
}
If I can get any help, it will be greatly appreciated.
Thanks,
Edward Kuk
phoneRegex = /^\(\d\d\d\) \d\d\d-\d\d\d\d$/;
if(! phone.rawValue.match( phoneRegex ) ) {
xfa.host.messageBox( "Please enter a valid phone number" );
this.rawValue = null;
}