These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Looking for javascript code for a number field

joanna_anna
Registered: Nov 13 2009
Posts: 16
Answered

Hi folks,

I am doing forms in Acrobat 9 Pro and need to specify the format of the 9-digit number users write in one of the fields. There should be a space after each three digits, like 234 212 543. So far, I have only been able to change the format of the number in the field properties so that I get Social Security Number... but what I get is 234-21-2543...

Is anybody who could help me and write a simple javascript code for me so that my numbers would have spaces after each three digits? I don't know any scripting...

THANKS for help! I really appreciate it!

Joanna

My Product Information:
Acrobat Pro 9.0, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
If you are in Acrobat and not LiveCycle Designer, you can use the "Special" option on the format tab and select the "Arbitrary" mask and enter '999 999 999' without the quotes into the entry field.

You other option is to use the RegExp object for the 'Custom' format and write the keystroke, format and validation scripts.

George Kaiser

joanna_anna
Registered: Nov 13 2009
Posts: 16
Thank you very much gkaiseril! We don't use Live Cycle Designer yet, but we are going to....

The 'arbitrary mask' works. My only concern is if I could remove the javascript window that shows up right after typing the numbers... I don't want to scare users of my forms...

thanks again!