PDF Editing Issues

Populate a Multiline PDF Text Field from Dropdowns in Adobe Acrobat

Elise WilliamsElise Williams Nov 19, 2026 869 views

Question details

Populate a multiline PDF text field with messages corresponding to dropdowns set to No, while excluding other selections.

Populate a Multiline PDF Text Field from Dropdowns in Adobe Acrobat
Product
Adobe Acrobat PDF forms
Device & OS
not provided
Scenario
A PDF form has several dropdowns with Blank, Yes, N/A, and No options and one field for the resulting messages.
Observed behavior
The desired result is a separate line of text for each dropdown set to No, with no text for the other selections.
Before you start

Open the form in Adobe Acrobat Pro and identify the exact field names and the value stored by each No option. Decide which message should appear for each dropdown.

Solution 1Recommended

Add a calculation script to the multiline field in Adobe Acrobat

Use a custom calculation script to rebuild the text field whenever form calculations run.

The example checks three dropdowns and joins their matching messages with line breaks. Replace the sample field names and messages with those in your form.

1
Open the form editor

In Acrobat Pro, open the PDF and select All tools > Prepare a form. Double-click the destination text field to open its properties.

2
Enable multiple lines

On the Options tab of the text field properties, select Multi-line.

3
Add the calculation script

On the Calculate tab, select Custom calculation script and click Edit. Enter this script, then replace Dropdown1, Dropdown2, and Dropdown3 and their messages with your own: var items = [ { field: "Dropdown1", message: "First item needs attention" }, { field: "Dropdown2", message: "Second item needs attention" }, { field: "Dropdown3", message: "Third item needs attention" } ]; var lines = []; for (var i = 0; i < items.length; i++) { var dropdown = this.getField(items[i].field); if (dropdown && dropdown.valueAsString === "No") { lines.push(items[i].message); } } event.value = lines.join("\n");

4
Save and test the form

Close the properties, save the PDF, and test each dropdown by selecting No and then another option. Confirm that matching messages appear on separate lines and disappear when No is no longer selected.

Add a calculation script to the multiline field in Adobe Acrobat
Check stored values and viewer support: If a dropdown uses an export value different from its visible No label, compare against that export value instead. Test in the intended PDF viewer: JavaScript support varies, especially on mobile devices.
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 PDFs and Microsoft Office files, making it easy to move between common document formats. Use Acrobat to create and test the custom PDF calculation script; WPS is not a fix for Acrobat JavaScript compatibility.

Open and review PDF documents alongside other filesCompatible with Microsoft Word, Excel, and PowerPoint formatsUse a familiar interface for everyday document tasksMove existing Office files into a lightweight workspace
microsoft office alternative - wps office

Frequently Asked Questions

Why does a dropdown set to No not add its message?

In Prepare a form, check the dropdown's exact field name and the No option's export value. Update the script to use that field name and compare against the stored export value.

How do I add more dropdowns to the calculation?

Open the destination field's Properties > Calculate > Custom calculation script > Edit. Add another field and message entry to the items array, using the dropdown's exact name.

Will the script work in a mobile PDF app?

Not necessarily. PDF JavaScript support varies by app and is often limited on mobile devices. Test the saved form in the specific mobile app your users will use.

How can I make the messages appear on separate lines?

In the destination field's Properties > Options, select Multi-line. The calculation script uses lines.join("\n") to separate the messages.