Solved

Custom field format on form

Posted on 2004-10-22
908 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
Question by:johnson00
    1 Comment
     
    LVL 44

    Accepted Solution

    by:
    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    One of the questions I get asked again and again is how to validate a field value in an AcroForm with a custom validation script. Adobe provided a lot of infrastructure to do that with just a simple script. Let’s take a look at how to do that wit…
    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 video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
    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…

    877 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now