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

Custom format for Text field

Community Beginner ,
Apr 29, 2021 Apr 29, 2021

Copy link to clipboard

Copied

Is there a way to customize the format of a field to format like an ontario drivers license with the dashes automatically inserted - similar to how they have the option for the US social security number, but in the format of ontario drivers license so XXXXX-XXXXX-XXX

 

Thanks

TOPICS
PDF forms

Views

2.9K

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 , Apr 29, 2021 Apr 29, 2021

Yes, go to field properties-> format tab -> then select 'special' -> arbitrary mask and enter 99999-99999-999

Votes

Translate

Translate
Community Expert ,
Apr 29, 2021 Apr 29, 2021

Copy link to clipboard

Copied

Yes, go to field properties-> format tab -> then select 'special' -> arbitrary mask and enter 99999-99999-999

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
Community Beginner ,
Apr 29, 2021 Apr 29, 2021

Copy link to clipboard

Copied

Thanks! Will this also allow people to enter a letter? Oour license is a combo of letters and numbers. Will they have to type in the dash?

 

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
Community Beginner ,
Apr 29, 2021 Apr 29, 2021

Copy link to clipboard

Copied

Me again, I figured my last question out - by using X  where a letter is required it works properly. One last question. Is there a way to make the letter always appear as a capital?

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
Community Expert ,
Apr 29, 2021 Apr 29, 2021

Copy link to clipboard

Copied

In that case you may need to use a custom key stroke script or custom format script with the util.printx() method and a couple of conditions to handle an infinite number of possibilites (not the arbitrary mask built-in feature).

 

I'm afraid the arbitrary mask built-in feature is somewhat limited in regards to alphanumeric combinations... but I may be wrong.

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
Community Expert ,
Apr 29, 2021 Apr 29, 2021

Copy link to clipboard

Copied

You'll find the specification for this type of formatting here, on the reference entry for the util.printx function:

https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/#t=Acro12_MasterBook%2FJS_API_Acro...

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
Community Expert ,
Apr 29, 2021 Apr 29, 2021

Copy link to clipboard

Copied

Can you indicate where the addition of a letter in upper case need to be added in that driver's license?

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
Community Expert ,
Apr 29, 2021 Apr 29, 2021

Copy link to clipboard

Copied

For example, if you decide to use the arbitrary mask built-in feature, keep in mind that, where there are numbers, they sbould be represented with a "9" and where an alphabet letter must be typed in,  it must be represented with an "A" for the propper format. The arbitrary mask format will throw errors if you use "X".

 

So, this is working for me with no script, for example:

 

99999-99A99-99A

 

Make sure you type it in as "A" in upper case or the program will expect to insert lower case "a" and throw the error.

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
Community Beginner ,
Apr 29, 2021 Apr 29, 2021

Copy link to clipboard

Copied

LATEST

Thanks for your help. It is only the first digit that is a letter. I found on another thread that this validation script will make letters display as Uppercase regardless of how they are typed in and I tried it out and it is working.

 

event.value = event.value.toUpperCase();

 

 

Thanks Everyone for your help.

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