How to Display Multiple PDF List Box Selections on One Line
Question details
The user wants to know if a multi-select list box in a PDF form can display its selected choices horizontally on a single line, separated by commas.

- Product
- Adobe Acrobat / PDF Forms
- Device & OS
- not provided
- Scenario
- Designing or filling out an interactive PDF form where multiple selected options from a list box need to be presented in a horizontal, comma-separated format.
- Observed behavior
- Native Acrobat list boxes strictly display their options vertically and do not support showing the selected choices themselves in a single comma-separated line.
Before proceeding, ensure you have a PDF editor that supports advanced form creation and custom JavaScript execution, as native list boxes cannot be formatted this way by default.
Use a Text Field with Custom JavaScript to Display Selections
Since Acrobat list boxes only display items vertically, you can use a separate text field and custom JavaScript to extract and display the selected values on one horizontal line.
While a multi-select list box inherently displays choices vertically in its UI, you can capture the user's selections and output them into a secondary text field. By applying a custom script, the selected array can be formatted into a comma-separated string, keeping the standard list box functional while achieving your desired display layout.
Create a list box in your PDF form, populate it with your desired options, and ensure 'Multiple selection' is enabled in the field properties under the Options tab.
Add a standard Text Field to your PDF precisely where you want the comma-separated selections to appear horizontally.
Open the List Box properties, navigate to the 'Actions' tab, select 'Selection Change' or 'On Blur' as the trigger, and choose 'Run a JavaScript'. Add a script that loops through the list box selections.
Write the JavaScript to collect the selected items into an array, join them using commas (e.g., using the .join(', ') method), and assign the resulting string to the value of your new text field.

Create and Manage PDF Forms Easily with WPS Office
WPS Office provides a comprehensive suite of PDF tools, allowing you to easily view, fill, create, and manage interactive PDF forms alongside your daily document tasks.
- 1. Open WPS Office: Launch WPS Office and switch to the PDF tab from the main workspace interface.
- 2. Load or Create a Form: Open your existing PDF document or create a new blank PDF to start building your form.
- 3. Access Form Controls: Navigate to the 'Form' tab on the top ribbon to insert interactive controls like Text Fields, Checkboxes, and Dropdown Lists.
- 4. Customize Field Properties: Right-click any inserted form field to adjust its properties, appearance, and data collection parameters.

Frequently Asked Questions
Can a PDF list box display items horizontally by default?
No, standard PDF list boxes are fundamentally designed to display options in a vertical column. To display selections horizontally, you must use a separate text field populated via JavaScript.
How do I allow multiple selections in a PDF list box?
Open the list box properties, navigate to the 'Options' tab, and check the box for 'Multiple selection'. This enables users to hold down Shift or Ctrl (Cmd on Mac) to select more than one item.
Will this custom JavaScript workaround function on all PDF viewers?
Not necessarily. While it works reliably in full-featured desktop PDF editors like Adobe Acrobat, basic browser-based PDF viewers or simple mobile apps might not execute the required JavaScript to format the selections.
Can I use commas to separate list box choices in the dropdown itself?
You cannot change the vertical layout of the dropdown list itself. Each distinct choice will always appear on a new line within the list box UI, regardless of punctuation.




