PDF Editing Issues

How to Populate a Text Field with Multiple List Box Selections in Acrobat PDF

Jason MillerJason Miller Oct 28, 2026 869 views

Question details

The user wants to extract multiple selected items from a list box and display them together in a separate text field.

How to Populate a Text Field with Multiple List Box Selections in Acrobat PDF
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Creating an interactive, fillable PDF form where a text field needs to automatically summarize or combine 3 to 5 names selected by a user from a list box.
Observed behavior
By default, the text field does not automatically retrieve multiple values from a list box. A custom JavaScript calculation script is required to pull the array of selections and format them as a single string.
Before you start

Ensure your PDF form is in editing mode and you have already created both the source list box and the destination text field on your document.

Solution 1Recommended

Apply Custom JavaScript to the Text Field

Use Acrobat's built-in custom calculation script feature to extract multiple selected values from a list box and display them as a comma-separated list.

This method requires writing a short JavaScript snippet in the text field's properties. The script retrieves the array of selected items from your list box and joins them into a single, readable string.

1
Enable Multiple Selections in List Box

First, ensure your list box allows multiple selections. Right-click your list box, go to Properties, navigate to the Options tab, and check the 'Multiple selection' box.

2
Open Text Field Properties

Right-click the destination text field where you want the names to appear and select 'Properties' from the context menu.

3
Navigate to the Calculate Tab

In the Text Field Properties dialog box, click on the 'Calculate' tab, then select the 'Custom calculation script' option and click the 'Edit' button.

4
Paste the Calculation Script

Enter the following code into the JavaScript editor: var v = this.getField("List Box1").value; if (typeof v == "object") event.value = v.join(", "); else event.value = v; (Be sure to replace "List Box1" with the exact name of your list box field), then click OK.

Testing the Script: Close the form editing mode and test your list box by holding Ctrl (or Cmd on Mac) to select multiple items. The text field should update automatically with the comma-separated values.

Easily Edit and Manage PDF Forms with WPS Office

While advanced JavaScript calculation requires specific Acrobat tools, you can easily view, fill, and manage PDF forms using WPS Office's intuitive PDF features without dealing with heavy software.

  1. 1. Download and Install: Get the free WPS Office suite from the official website and launch the application on your computer.
  2. 2. Open Your PDF: Click 'Open' on the home screen and select your PDF form to launch it in the WPS PDF editor.
  3. 3. Fill and Edit: Use the 'Fill & Sign' or 'Form' tools available in the top ribbon to seamlessly interact with text fields, list boxes, and checkboxes.
Seamlessly view and fill interactive PDF formsHighly compatible with standard Adobe Acrobat PDF formatsLightweight, fast, and completely user-friendly interfaceAll-in-one suite for processing PDF, Word, Excel, and PowerPoint files
microsoft office alternative - wps office

Frequently Asked Questions

Why does my text field only show one value instead of multiple?

Make sure that the 'Multiple selection' option is enabled for your list box. You can find this setting by right-clicking the list box, selecting Properties, and checking the option under the Options tab.

How can I format the list to appear on separate lines instead of using commas?

In your JavaScript code, change the separator from a comma and space (", ") to a newline character ("\n"). Additionally, ensure that your destination text field has the 'Multi-line' option checked in its Properties under the Options tab.

Does this JavaScript work automatically on all PDF readers?

Form calculation scripts rely on the PDF reader's JavaScript engine. While it works perfectly in Adobe Acrobat and professional PDF editors, some basic mobile PDF viewers or web browser extensions may not support JavaScript calculations fully.