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

Custom Formatting for Social Security Number

Participant ,
Apr 09, 2023 Apr 09, 2023

First of all, I'm running Adobe Acrobat 9 Standard.  (I know, it's old)

If anyone can tell me how to get a newer version for a "one time" fee, and does not require subscription pricing, I'd appreciate it.

 

I can use the custom formatting for SSN: 123-45-6789

But I'd like to us a formatting "pattern?" that will give me: 123 - 45 - 6789.

 

I did it for date by choosing custom date and entering: mm - dd - yyyy.

I can't figure out how to do the same for a Social Security Number.

TOPICS
Create PDFs , JavaScript , PDF forms
2.4K
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 ,
Apr 10, 2023 Apr 10, 2023
LATEST

Select the Special option under the Format tab, then Arbitrary Mask and enter into it (without the quotes): "999 - 99 - 9999"

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 ,
Apr 10, 2023 Apr 10, 2023

There is no easy solution as with the date: The "mm", "dd", and "yyyy" patterns have special meaning. For a custom formatting of the social security number, you need to dig a bit deeper into Acrobat's features. The following is a very simple way to accomplish this, but it does not check for a valid pattern of the SSN:

 

var groups = event.value.split('-');
var ss_num = groups.join(' - ');
event.value = ss_num;

You would use this script as a custom formatting script. If you want to do a bit more pattern matching, you could use regular expressions to make sure that you have a pattern of three digits followed by a '-', followed by two digits, followed by '-' and finally followed by four digits. 

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 ,
Apr 10, 2023 Apr 10, 2023
LATEST

Select the Special option under the Format tab, then Arbitrary Mask and enter into it (without the quotes): "999 - 99 - 9999"

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