PDF Editing Issues

How to Get a List Box Item Display Value in an Acrobat Form

Camila MilosovichCamila Milosovich Nov 5, 2026 870 views

Question details

The user needs to retrieve the visible text of a selected list box item and populate it into another text field, bypassing the default export value.

How to Get a List Box Item Display Value in an Adobe Acrobat Form
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Designing an interactive PDF form where a user's selection in a list box needs to display its text label in a separate hidden or visible text field.
Observed behavior
By default, referencing a list box field retrieves its export value instead of the actual text displayed to the user in the form.
Before you start

Ensure you have a PDF editing program that supports adding custom JavaScript to form fields, such as Adobe Acrobat Pro. Note the exact field name of your list box before writing the script.

Solution 1Recommended

Use a Custom Calculation Script to Retrieve the Display Value

Apply a custom JavaScript calculation to the destination text field to capture the selected index of the list box and retrieve its text string instead of the export value.

By default, when you reference a list box in a PDF form, it returns the export value associated with the selection. To capture the visible text (the display value), you need to find the index of the selected item and use the getItemAt() method.

1
Open Form Properties

Open your PDF in Form Editing mode. Double-click the destination text field (the field where you want the value to appear) to open its Properties dialog box.

2
Navigate to the Calculate Tab

Click on the 'Calculate' tab at the top of the Properties window and select the 'Custom calculation script' option.

3
Enter the JavaScript Code

Click the 'Edit' button and paste the following script: var f = this.getField("List.Box.B"); var a = f.currentValueIndices; event.value = f.getItemAt(a, false);

4
Customize the Field Name

Replace 'List.Box.B' in the script with the exact name of your list box field. Make sure to keep the quotation marks.

5
Save and Test

Click 'OK' to close the JavaScript editor, then click 'Close' on the Properties window. Exit Form Editing mode and test the list box to ensure the destination field populates with the correct display text.

Use a Custom Calculation Script to Retrieve the Display Value
Understanding the Script: The 'false' parameter in the getItemAt(a, false) function specifically instructs the script to return the face value (the displayed text) of the item rather than its export value.

Easily Manage and Fill PDF Forms with WPS Office

WPS Office includes a highly capable PDF editor that allows you to view, fill, and interact with complex PDF forms smoothly. It serves as an excellent, lightweight alternative for your daily PDF document needs.

  1. 1. Open WPS Office: Launch WPS Office and click on 'PDF Edit' or simply open your existing PDF form document.
  2. 2. Interact with Form Fields: Navigate to the form fields. WPS PDF automatically highlights fillable areas, allowing you to select list box items or type in text fields directly.
  3. 3. Save Your Form: Once the form is filled out, click 'Save' or 'Export' to securely store the completed document with all selections intact.
Seamlessly interact with fillable PDF forms, including list boxes and text fieldsFully compatible with standard Adobe PDF document formatsLightweight, fast, and features an intuitive user interfaceCreate, edit, and convert PDFs across multiple platforms easily
microsoft office alternative - wps office

Frequently Asked Questions

Why does my list box default to the export value?

In PDF form architecture, the export value is typically used as the primary data point for backend processing and calculations, which is why default scripts pull the export value rather than the visual text label.

Can I use this same script for a drop-down (combo box) field?

Yes, the process is very similar. You can use the currentValueIndices property on a combo box to determine which item is selected and retrieve its display text using the getItemAt method.

What happens if multiple items are selected in the list box?

If your list box allows multiple selections, the currentValueIndices property will return an array of indices instead of a single number. You would need to write additional JavaScript to loop through the array and extract the text for each selected item.