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

Docket number format

New Here ,
Dec 27, 2023 Dec 27, 2023

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!

TOPICS
Create PDFs , How to , PDF

Views

189

Translate

Translate

Report

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

correct answers 1 Correct answer

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

 

Votes

Translate

Translate
Community Expert ,
Dec 27, 2023 Dec 27, 2023

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

 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

Worked perfectly, thanks so much!!!

Votes

Translate

Translate

Report

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