Copy link to clipboard
Copied
I've heard that RedEx script is needed to accomodate more than one arbitrary mask format in a field. How might I be able to allow for the two formats in one field as follows?:
Format 1: OOOOOOOOOOO (11 characters)
Format 2: OOOOOOOOOO (10 characters)
Thank you in advance!
Thank you. I was given the below validation script and it worked!
var str = event.value;
var reg = /^[a-zA-Z]{1,2}[0-9]{9}$/;
var r = reg.test(str);
if(!r)
app.alert("Your message goes here",3);
Copy link to clipboard
Copied
What does "O" stand for? Any character whatsoever?
And do you want it to only accept a value that's 10 or 11 characters long?
If so, you need a validation script, not a format script.
Copy link to clipboard
Copied
Thank you. I was given the below validation script and it worked!
var str = event.value;
var reg = /^[a-zA-Z]{1,2}[0-9]{9}$/;
var r = reg.test(str);
if(!r)
app.alert("Your message goes here",3);