• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1467
  • Last Modified:

Custom field format on form

I have a form I'm working with in Adobe Acrobat and need a custom script to put numbers entered into the format, ######/#####, and I also need one for a field that must be 10 numbers in length, where if the user enters "123", the result is "0000000123".  I have never used javascript before, so if I'm able to do this without custom scripts somehow, that would be great.

1 Solution
Karl Heinz KremerCommented:
For the leading zeros, open up the properties for your text field and select the "Format" tab. Select a "Custom" format and then click on the "Edit" button for the "Custom Format Script". Use this script:

event.value = util.printf("%0 11d", event.value);

This will fill up the number with leading zeros until you have a 10 character long string.

I'm not sure what you mean by ######/#####. Will you always have 11 digits? If so, you can use this as the custom format script:

event.value = util.printx("999999/99999", event.value);
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now