Copy link to clipboard
Copied
Hi,
I'm trying to make sure that information input into a field is formatted in a specific way, 99-XX-999. I can do this with an arbitrary mask, but it won't capitalize the letters. How do I get this format and make sure the letters are capitalized, regardless of how they are entered?
Thanks!
Instead of arbitrary mask, use this as 'Validate' script:
var str = event.value;
var s = util.printx("99->XX-999", str);
var reg = /^\d{2}-[A-Z]{2}-\d{3}$/.test(s);
if(event.value){
if(!reg){
event.rc = false;
app.alert("Your message goes here",3);}
else
event.value = s;}
Copy link to clipboard
Copied
Instead of arbitrary mask, use this as 'Validate' script:
var str = event.value;
var s = util.printx("99->XX-999", str);
var reg = /^\d{2}-[A-Z]{2}-\d{3}$/.test(s);
if(event.value){
if(!reg){
event.rc = false;
app.alert("Your message goes here",3);}
else
event.value = s;}
Copy link to clipboard
Copied
Worked perfectly, thanks so much!!!