Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Custom field format on form

Posted on 2004-10-22
1
Medium Priority
?
1,359 Views
Last Modified: 2012-08-13
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.

Thanks!
0
Comment
Question by:johnson00
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 2000 total points
ID: 12384157
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);
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe In a previous Experts Exchange article, How To Rename-Move a Batch of PDF Files Based on Contents of the Files (http://www.experts-exchan…
Inserting page numbers in Portable Document Files not only enhances manageability but also makes them look professional. With numbered pages, the file appears more organized and it becomes easier to search for a particular page. The size and the vol…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
We often encounter PDF files that are pure images, that is, they do not have text characters, but instead contain only raster graphics. The most common causes of this are document scanning software and faxing software/services that create image-only…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question