PDF Editing Issues

How to Show a Text Field When 'Other' is Selected in a PDF Drop-Down

Natalie TaylorNatalie Taylor Oct 28, 2026 868 views

Question details

The user wants to allow respondents to enter a custom value by revealing a hidden text field only when the 'Other' option is selected from a drop-down menu in a PDF form.

How to Show a Text Field When 'Other' is Selected in a PDF Drop-Down
Product
Acrobat PDF
Device & OS
not provided
Scenario
Creating an interactive PDF form where predefined drop-down options might not cover all user responses, requiring a conditional custom text input.
Observed behavior
A text field should remain hidden by default and automatically become visible when the user selects 'Other' from the associated drop-down menu.
Before you start

Ensure you are using a PDF editing program that supports advanced form field properties and JavaScript custom calculation scripts.

Solution 1Recommended

Use a Custom Calculation Script in the Text Field

Add a simple JavaScript code snippet to your text field's properties to monitor the drop-down menu and toggle visibility dynamically.

To achieve this, you need a separate text field designed specifically to capture the custom value. By applying a custom calculation script to this text field, it will check the current value of your drop-down menu and show or hide itself accordingly.

1
Create the drop-down menu

Insert a drop-down menu field into your PDF form. Note its exact field name (e.g., 'Dropdown1') and ensure 'Other' is listed as one of the item export values.

2
Add a separate text field

Create a new text field next to the drop-down menu where you want the custom input box to appear.

3
Apply the calculation script

Right-click the text field and open its Properties. Navigate to the 'Calculate' tab, select 'Custom calculation script', and enter the following code: event.target.display = (this.getField("Dropdown1").valueAsString == "Other") ? display.visible : display.hidden;

4
Update the field name

If your drop-down menu is not named 'Dropdown1', replace 'Dropdown1' in the script with your actual drop-down field name.

Use a Custom Calculation Script in the Text Field
Case Sensitivity: JavaScript is case-sensitive. Ensure that the field name and the word 'Other' in your script exactly match the capitalization used in your form fields.
Create Interactive Forms Easily

Build Smart PDF Forms with WPS Office

WPS Office provides a comprehensive PDF editor that allows you to design interactive forms, insert drop-down menus, and manage text fields with an intuitive, user-friendly interface.

  1. 1. Open your PDF: Launch WPS Office and open your PDF document.
  2. 2. Access the Form tab: Navigate to the 'Form' tab on the top ribbon to access interactive tools.
  3. 3. Insert form elements: Click on 'Drop-down List' or 'Text Field' and drag to draw the elements onto your document.
  4. 4. Configure properties: Double-click the inserted fields to set up names, options, and visibility settings.
Easily insert and customize interactive PDF form fields like drop-downs and text boxes.Highly compatible with standard Adobe Acrobat PDF forms and Microsoft Office document formats.Lightweight, fast, and features an intuitive interface for editing PDFs seamlessly.
microsoft office alternative - wps office

Frequently Asked Questions

Why isn't the text field appearing when I select 'Other'?

This usually happens if the field name in your script does not exactly match the drop-down menu's actual name, or if the value 'Other' has a typo or different casing in the drop-down's export values.

Will the text field hide again if the user selects a different option?

Yes. The provided calculation script automatically re-evaluates whenever the drop-down value changes. If a user changes their selection from 'Other' to a predefined option, the text field will be hidden again.

Does this JavaScript work in all PDF readers?

This script works perfectly in standard PDF editors like Adobe Acrobat and advanced readers. However, some basic web browser PDF viewers or default system readers may not fully support JavaScript form calculations.