Create Conditional Follow-Up Questions in Acrobat PDF Forms
Question details
The user wants to implement conditional logic in a PDF form to dynamically display a follow-up text field when a specific option, such as "Other", is selected from a drop-down list.

- Product
- Adobe Acrobat Pro
- Device & OS
- not provided
- Scenario
- Designing an interactive PDF form where certain questions only appear based on the user's previous answers.
- Observed behavior
- Needs a method to show a hidden text field dynamically when "Other" is selected and hide it otherwise using form JavaScript.
Ensure you are using Adobe Acrobat Pro, as the free Adobe Acrobat Reader does not have the capability to create form fields or add custom JavaScript validation.
Use Custom JavaScript to Show or Hide Fields
You can achieve conditional logic by adding a custom validation script to the drop-down field, which controls the visibility of the follow-up text field.
In Adobe Acrobat Pro, form fields can be dynamically controlled using JavaScript. By setting the follow-up field to be hidden by default, you can trigger its visibility when a specific value is chosen from your drop-down menu.
Open your document in Adobe Acrobat Pro and go to 'Tools' > 'Prepare Form'. Add a drop-down list for the main question and a text field for the follow-up question.
Right-click the follow-up text field and select 'Properties'. Go to the 'General' tab and change the 'Form Field' property from 'Visible' to 'Hidden'. Note the exact name of this field for the script.
Right-click the drop-down list and open its 'Properties'. Navigate to the 'Validate' tab, select 'Run custom validation script', and click 'Edit'.
Enter a script that checks the drop-down's value. For example: if (event.value == "Other") { this.getField("YourTextFieldName").display = display.visible; } else { this.getField("YourTextFieldName").display = display.hidden; }
Click 'Preview' at the top right of the Prepare Form toolbar. Select "Other" from the drop-down to ensure the text field appears, and select a different option to ensure it hides.

Design Interactive PDF Forms with WPS Office
While advanced JavaScript logic requires specialized tools, you can easily design, create, and fill standard interactive PDF forms using the intuitive PDF tools in WPS Office.
- 1. Open the PDF tool: Launch WPS Office and open your existing PDF document or create a new blank PDF.
- 2. Access form controls: Navigate to the 'Form' tab on the top ribbon to access the interactive form creation tools.
- 3. Insert form elements: Click on 'Text Field', 'Check Box', or 'Combo Box' and click on the page to insert the element.
- 4. Adjust properties: Double-click the inserted field to rename it, adjust its appearance, or add drop-down options.
- 5. Save and share: Save your document. The form is now ready to be filled out by anyone using a standard PDF reader.

Frequently Asked Questions
Why does my hidden text field stay visible after changing the drop-down answer?
This happens if your JavaScript lacks an "else" condition. Your script must explicitly tell the PDF to hide the field again when a value other than "Other" is selected. Ensure your script includes an 'else' block setting the display to 'display.hidden'.
Does JavaScript conditional logic work on mobile PDF readers?
Most mobile PDF viewers have limited or no support for Adobe form JavaScript. For conditional fields to work reliably, users should open the form on a desktop PDF reader like Adobe Acrobat, WPS PDF, or Foxit.
Can I use this logic to show multiple fields at once?
Yes. You can add multiple lines of code inside your 'if' statement to target different field names, changing the display property to visible for several fields simultaneously when "Other" is selected.




