How to Make Drop-Down List Options Unselectable in a PDF Form
Question details
The user wants to display category headings within a PDF drop-down list but prevent users from selecting them, allowing only numbered options or the default blank value to be chosen.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating an interactive PDF form with categorized drop-down lists where headers should serve only as visual separators.
- Observed behavior
- When users click a non-selectable category heading, the selection needs to be rejected and either remain blank or revert to the previously selected valid numbered item.
Ensure you have access to the 'Prepare Form' tools in your PDF editor and verify the exact text of your default blank option or placeholder (e.g., 'Select').
Apply a Custom Validation Script
Use JavaScript in the drop-down field's validation settings to restrict selections to items starting with a number or the default blank value.
PDF form fields allow custom JavaScript to validate user input. By adding a specific script, you can reject selections that do not match your criteria, effectively turning certain list items into unselectable category headings.
Open your PDF document in Adobe Acrobat, navigate to the 'Tools' menu, and select 'Prepare Form'.
Right-click the target drop-down list field and select 'Properties' from the context menu.
Navigate to the 'Validate' tab, select 'Run custom validation script', and click the 'Edit' button.
Paste the following script into the editor: if (event.value) event.rc = /^\d/.test(event.value) || event.value == event.target.defaultValue;
Click 'OK' to save the script, then close the properties window. Switch to 'Preview' mode to test the drop-down list and ensure category headings cannot be selected.

Create and Manage PDF Forms Easily with WPS Office
WPS Office provides a comprehensive PDF editor that lets you quickly create, edit, and manage interactive PDF forms without needing complex programming knowledge.
- 1. Launch PDF Editor: Open WPS Office and click on the 'PDF' tab to view or edit your document.
- 2. Access Form Tools: Navigate to the 'Form' tab in the top ribbon to reveal form creation and editing tools.
- 3. Insert Drop-down List: Select the 'Combo Box' tool and click anywhere on the document page to place your drop-down list.
- 4. Customize Options: Double-click the new drop-down field to open its properties, where you can easily add, arrange, or remove list items.

Frequently Asked Questions
Can I allow a specific text like 'Select an option' instead of a blank value?
Yes, you can modify the validation script. Change the condition to explicitly allow your specific text placeholder, for example: event.value == 'Select an option' instead of referencing the defaultValue.
Why does my drop-down revert to the previous selection when I click a category heading?
The validation script rejects the category heading because it doesn't match the allowed criteria (starting with a number). When a selection is rejected by validation, the PDF form field automatically reverts to the last valid selection made by the user.
Does this JavaScript validation work on mobile PDF readers?
Custom JavaScript validation in PDF forms is widely supported in desktop applications like Adobe Acrobat and WPS Office, but many third-party mobile PDF viewers do not fully support JavaScript. It is recommended to test your form on the specific mobile apps your target audience will use.
How do I add items to the drop-down list before applying the validation script?
In the drop-down field's Properties window, go to the 'Options' tab. Here you can type your item names—including category headings and numbered items—in the 'Item' field and click 'Add' for each one to populate the list.




