Populate a PDF form field based on drop-down selection

Posted on 2008-11-05
Last Modified: 2012-05-05
I created a PDF form using Acrobat 8 Pro.
I have a drop down field called 'Location' and I have pre-populated it with 8 location names.
I have a text box field called 'Address' and it is blank.

When the user selects one of the locations from the 'Location' drop-down list, I want the field called 'Address' to automatically populate with that location's address.

How do I do this?
Question by:ecarbone
    LVL 44

    Accepted Solution

    I assume you know how to add JavaScript to a form field. For the following to work, you need to create a custom validation script for your list box ("Location"). Just replace the "ValueX" strings with the actual strings from your list box, and the "txtX" strings with your address strings.
    var v = event.value;
    var targetValue = "";
    if (v == "Value1")
        targetValue = "txt1";
    else if (v == "Value2")
        targetValue = "txt2";
    else if (v == "Value3")
        targetValue = "txt3";
    else if (v == "Value4")
        targetValue = "txt4";
    this.getField("Address").value = targetValue;

    Open in new window

    LVL 10

    Author Closing Comment

    Exactly what I was looking for ... thank you!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Adobe Photoshop CC 2015

    Photoshop has become the standard in image manipulation among professional photographers and graphic designers. This course covers exam objectives for the Adobe Certified Associate (ACA) certification.

    This article is in response to a question here ( at Experts Exchange. The Original Poster has a scanned signature and wants to make the background transparent so that the signature may be pl…
    In a previous article published here at Experts Exchange, Signature Image with Transparent Background (, I explained how to cre…
    In this second video of the Xpdf series, we discuss and demonstrate the PDFimages utility, which, in a single command, is able to extract all the images from a PDF file and save each one in a separate image file (PBM, PPM, or JPG). Download and inst…
    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…

    761 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

    13 Experts available now in Live!

    Get 1:1 Help Now