PDF Editing Issues

Show Acrobat PDF Form Fields After an Item Number Is Entered

Adam DavisAdam Davis Nov 19, 2026 868 views

Question details

Show the unit-of-measure and calculated total fields in a purchase order PDF only after an item number is entered.

Show Acrobat PDF Form Fields After an Item Number Is Entered
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A purchase order form has an item number, unit of measure, and calculated total for each row.
Observed behavior
The unit-of-measure and total fields should be hidden when the item number is empty and visible when it has a value.
Before you start

Open the PDF in Adobe Acrobat and identify the exact field names for each item number, unit of measure, and total. Confirm that the item number is a text field and that Acrobat JavaScript is enabled for testing.

Solution 1Recommended

Use an Acrobat validation script to control field visibility

Apply a custom validation script to each item number field so its related fields appear when a value is entered.

1
Open the form editor

In Acrobat, open the purchase order PDF and select Prepare a form. Check the field names in the form editor.

2
Hide the dependent fields

For a blank form, open Properties for each unit-of-measure and total field. On the General tab, set Form Field to Hidden so the fields start out hidden.

3
Add the validation script

Open Properties for the first item number field, such as N1. On the Validate tab, select Run custom validation script, click Edit, and enter: this.getField("U1").display = event.value == "" ? display.hidden : display.visible; this.getField("T1").display = event.value == "" ? display.hidden : display.visible;

4
Repeat for other rows

Replace U1 and T1 with the exact unit-of-measure and total field names for that row. Open each remaining item number field's Validate tab and add the corresponding script with its own field names.

5
Test the form

Save the PDF, exit form editing, and enter an item number. Commit the entry by moving focus to another field; the related fields should appear. Clear the item number and move focus again to confirm they are hidden.

Use an Acrobat validation script to control field visibility
Check the PDF viewer: The script requires a PDF viewer that supports Acrobat form JavaScript. If the form already contains item numbers, test its initial visibility separately; validation runs when a field value is committed.
Free Microsoft Office alternative

Work with purchase order documents in WPS Office

WPS Office is a free, lightweight alternative for working with office documents and PDFs in a familiar interface. Its Microsoft Office format support helps you move existing files across; use Acrobat to configure and test the JavaScript visibility behavior described above.

Open and work with purchase order documents and PDFsCompatible with Microsoft Office formats including DOCX and XLSXFamiliar interface for a smoother transition from Microsoft OfficeFree, lightweight office tools
microsoft office alternative - wps office

Frequently Asked Questions

Where do I add the visibility script in Acrobat?

Select Prepare a form, open the item number field's Properties, and use Validate > Run custom validation script > Edit. Add the script to the item number field, not the fields being shown or hidden.

How do I keep the unit and total fields hidden when the form opens?

For a blank form, open each dependent field's Properties in Prepare a form and set Form Field to Hidden on the General tab. Test the initial state separately if the PDF already has item numbers.

Why do the fields appear only after I leave the item number field?

The validation script runs when the entry is committed. After typing the item number, press Tab or click another field to trigger validation.

Will the script work in every PDF viewer?

No. The viewer must support Acrobat form JavaScript and allow it to run. Test the saved PDF in the viewer your form users will use.