Prevent Invalid Drop-Down Selections in an Adobe Acrobat Form
Question details
Reject a drop-down selection unless a related Member checkbox is selected, restoring the previous value when the choice is invalid.

- Product
- Adobe Acrobat PDF forms
- Device & OS
- not provided
- Scenario
- A form has a drop-down option that is permitted only when the Member checkbox is selected.
- Observed behavior
- An invalid drop-down choice should be rejected and the field should retain its previously committed value.
Open the PDF in Adobe Acrobat with access to form editing. In Prepare a Form, check the checkbox field name and checked export value, as well as the drop-down option's export value.
Reject the invalid choice with an Acrobat validation script
Use a custom validation script to keep the previous committed drop-down value when the Member checkbox is not selected.
In Acrobat, open the PDF and choose All tools > Prepare a form. Double-click the drop-down field to open its Properties dialog.
On the Validate tab, select Run custom validation script and click Edit. Enter: if (this.getField("Member").value !== "Yes" && event.value === "Invalid Choice") { event.rc = false; }
In the script editor, replace Member with the checkbox field name, Yes with its checked export value, and Invalid Choice with the drop-down option's export value. Save the script and close Properties.
On the drop-down field's Options tab, enable Commit selected value immediately if you want validation to run as soon as the selection changes. Close form editing, leave Member unchecked, and select the restricted option; then check Member and try again.

Work with PDFs and Office files in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Office documents. Its format support makes it easy to bring existing files into your workflow, although it does not replace Acrobat's form validation scripting.

Frequently Asked Questions
How does the script restore the previous drop-down value?
Setting event.rc to false in the drop-down field's custom validation script rejects the new value, so the previously committed value remains.
How do I find the checkbox's checked value?
In Prepare a Form, double-click the checkbox and check its Options tab for the export value. Use that value in place of Yes in the script.
Why doesn't validation happen as soon as I select an option?
Open the drop-down field's Properties, go to Options, and enable Commit selected value immediately. Otherwise, validation generally runs when the value is committed, such as when you leave the field.
What happens if I uncheck Member after choosing the restricted option?
The drop-down validation script does not automatically run when the checkbox changes. Additional form logic is needed if the existing selection must also be cleared or rejected in that case.




