Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
11

Docket number format

New Here ,
Dec 27, 2023 Dec 27, 2023

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!

TOPICS
Create PDFs , How to , PDF
473
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Dec 27, 2023 Dec 27, 2023

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;}

 

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2023 Dec 27, 2023

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;}

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 27, 2023 Dec 27, 2023
LATEST

Worked perfectly, thanks so much!!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines