PDF Editing Issues

Map Acrobat Dropdown Selections to Multiple PDF Form Fields

Camila MilosovichCamila Milosovich Nov 19, 2026 870 views

Question details

Populate several rental fields based on the truck model selected in a PDF form dropdown.

Map Acrobat Dropdown Selections to Multiple PDF Form Fields
Product
Adobe Acrobat Pro
Device & OS
not provided
Scenario
A rental form has model dropdowns and related depreciation, value, and weekly charge fields for up to 30 trucks.
Observed behavior
Each model selection should populate the corresponding rental fields using a shared data set.
Before you start

Open the form in Acrobat Pro and check the exact field names and dropdown export values in Prepare a form. Make sure JavaScript is enabled in Acrobat and that the PDF viewer used for testing supports Acrobat form scripts.

Solution 1Recommended

Use a Document-Level Script to Map Truck Models to Rental Fields

Use one shared data object and mapping function for all 30 truck dropdowns instead of maintaining separate data in each field.

This example assumes dropdown names T01t through T30t and corresponding fields ending in d, v, and w. Replace the sample models and amounts with your actual data. Dropdown export values must match the model keys.

1
Check the form field names

Open All tools > Prepare a form and inspect the field properties. For the first truck, use T01t for the dropdown and T01d, T01v, and T01w for depreciation, value, and weekly charge; follow the same pattern through T30.

2
Add the shared document script

Open All tools > Use JavaScript > Document JavaScripts, create a script, and enter: var truckData = { "Model A": { d: 100, v: 25000, w: 500 }, "Model B": { d: 150, v: 30000, w: 650 } }; function mapTruck(doc, dropdownName, model) { if (!/^T(?:0[1-9]|[12][0-9]|30)t$/.test(dropdownName)) return; var prefix = dropdownName.slice(0, -1); var data = Object.prototype.hasOwnProperty.call(truckData, model) ? truckData[model] : null; var suffixes = ["d", "v", "w"]; for (var i = 0; i < suffixes.length; i++) { var suffix = suffixes[i]; var field = doc.getField(prefix + suffix); if (field) field.value = data ? data[suffix] : ""; } }

3
Attach the mapping to each dropdown

In Prepare a form, open a dropdown's Properties. On the Validate tab, select Run custom validation script and enter: mapTruck(this, event.target.name, event.value); Apply the same script to each truck dropdown.

4
Commit and test selections

In each dropdown's Properties > Options, enable Commit selected value immediately. Save the PDF, select each sample model in a dropdown, and confirm that its matching d, v, and w fields update. Test an empty or unmatched selection to confirm those fields clear.

Use a Document-Level Script to Map Truck Models to Rental Fields
Viewer support matters: PDF viewers do not all support Acrobat JavaScript. Test the saved form in the viewer your recipients will use; opening the PDF alone does not guarantee that its scripts will run.
Free Microsoft Office alternative

Work With PDFs and Office Documents in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with Office documents and PDFs. Its format compatibility helps you move existing files into your workflow. Use Acrobat for the JavaScript-based form mapping described above; WPS is not a replacement for testing that script.

Open and work with PDFs alongside office documentsCompatible with Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXFamiliar interface for an easier transition from Microsoft OfficeFree, lightweight software for everyday document tasks
microsoft office alternative - wps office

Frequently Asked Questions

Why do my rental fields stay blank after I select a truck model?

In Prepare a form, check that the dropdown name follows the T01t pattern, the destination fields use the matching T01d, T01v, and T01w names, and the dropdown export value matches a key in truckData. Also check that the validation script is attached and JavaScript is enabled.

How do I add another truck model?

Open Use JavaScript > Document JavaScripts and add another entry to truckData with the model's dropdown export value as its key and d, v, and w values for its rental fields.

Can I use different field names?

Yes. Edit the name check and prefix logic in mapTruck, as well as the suffixes array, to match your form. The destination field names must be derivable from the dropdown name for the shared function to find them.

Will the script work in every PDF viewer?

No. Acrobat JavaScript support varies by viewer. Test the saved form in the intended recipient's viewer, including whether dropdown changes populate the related fields.