PDF Editing Issues

Show the Selected Lab Address in an Adobe Acrobat PDF Form

Tauseeq MagsiTauseeq Magsi Nov 19, 2026 868 views

Question details

The user needs a PDF form to display the address of the selected testing laboratory and hide the other address.

Show the Selected Lab Address in an Adobe Acrobat PDF Form
Product
Adobe Acrobat PDF forms and Adobe Sign
Device & OS
not provided
Scenario
A user selects one of two testing laboratories in a form originally created as an Adobe Sign form.
Observed behavior
The desired form shows the selected lab's address, hides the unselected address, and shows neither address when no lab is selected.
Before you start

Gather the two lab addresses and decide on the labels users will see in the dropdown. You will need Adobe Acrobat with form-editing and JavaScript capabilities, plus a standard PDF form rather than an Adobe Sign form.

Solution 1Recommended

Use a dropdown and JavaScript in a standard Acrobat form

Use this method to show one of two existing address fields based on the selected lab.

Adobe Sign forms do not support the same Acrobat JavaScript workflow. Start with the original non-Sign PDF or recreate the fields in a standard Acrobat PDF form.

The example below uses a dropdown with export values of None, Lab A, and Lab B. The address field names and export values must match the script exactly.

1
Open a standard PDF form

In Acrobat, open the original non-Sign PDF and choose All tools > Prepare a form. If necessary, recreate the form fields rather than using the Adobe Sign fields.

2
Add the address fields

In Prepare a form, add two text fields named LabAAddress and LabBAddress and enter the corresponding addresses. Open each field's Properties, mark it read-only, and set its initial Form Field visibility to Hidden.

3
Create the lab dropdown

Add a dropdown field and open its Properties > Options. Add a prompt such as Select a lab with the export value None, followed by options with export values Lab A and Lab B. Select the prompt as the initial value and enable Commit selected value immediately.

4
Add the visibility script

In the dropdown's Properties > Validate tab, choose Run custom validation script and select Edit. Enter: this.getField("LabAAddress").display = event.value === "Lab A" ? display.visible : display.hidden; this.getField("LabBAddress").display = event.value === "Lab B" ? display.visible : display.hidden;

5
Test each selection

Save the PDF, exit form editing, and select each lab from the dropdown. Confirm that only its address appears, then select the prompt and confirm that both addresses are hidden.

Use a dropdown and JavaScript in a standard Acrobat form
Check the PDF viewer: Test the saved form in Acrobat or Acrobat Reader with JavaScript enabled. Browser and other PDF viewers may not run Acrobat form scripts.
Free Microsoft Office alternative

Work with PDF and Office files in WPS Office

WPS Office is a free, lightweight alternative for everyday document work, with a familiar interface and compatibility with Microsoft Office formats to make migration easier. It does not replace the Acrobat JavaScript workflow required for this form.

Open and review PDF documents alongside your other office filesCompatible with Microsoft Word DOCX, Excel XLSX, and PowerPoint PPTX formatsFamiliar editing interface for a smoother transition from Microsoft OfficeFree, lightweight suite for everyday document tasks
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't the script work in my Adobe Sign form?

Adobe Sign forms do not support the same Acrobat JavaScript workflow. Open the original non-Sign PDF in Acrobat's Prepare a form tool and create standard PDF fields for the dropdown and addresses.

How do I hide both addresses before a lab is selected?

Set each address field's Form Field visibility to Hidden in its Properties. Make the dropdown's initial option a prompt with an export value such as None, so the script hides both fields when that option is selected.

Why doesn't the address change when I select a different lab?

In the dropdown's Properties > Options, enable Commit selected value immediately. Then check that the field names and dropdown export values match those used in the validation script.

Will the form work in a browser PDF viewer?

Not necessarily. Some browser viewers do not run Acrobat form JavaScript. Test the form in Acrobat or Acrobat Reader with JavaScript enabled before distributing it.