Show and Hide PDF Form Fields in Adobe Acrobat
Question details
The user wants to reveal or hide descriptions and checkboxes by clicking a category header in a PDF form.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating a PDF form with category headers that control the visibility of related content.
- Observed behavior
- The desired form would show or hide a category's descriptions and checkboxes when its header is clicked.
Open the PDF in Acrobat and check that you can access Prepare a form. Identify the descriptions and checkboxes that should appear together; descriptions must be form fields if you want to control their visibility with a button.
Toggle Form Fields with an Acrobat Button
Use a button and JavaScript to show or hide a description field and checkbox within a fixed PDF layout.
Acrobat can change form-field visibility, but this does not create a dynamically expanding section: the surrounding page content will not automatically move to fill or create space.
The toggle depends on JavaScript support in the PDF viewer. Test the form in the Acrobat or Reader versions your recipients will use.
Open All tools > Prepare a form. Add a text field for the description and a checkbox, and name them Description and CategoryCheck in their field properties. Make the description field read-only if users should not edit it.
Open Properties for each field and use the General tab's Form Field setting to make both fields hidden initially. Reserve space for them in the page layout.
In Prepare a form, add a button over or beside the category header. Open its Properties and use the Options tab to give it a recognizable label.
In the button's Properties, open Actions. Select Mouse Up as the trigger and Run a JavaScript as the action, then click Add. Enter: var desc = this.getField('Description'); var check = this.getField('CategoryCheck'); var state = desc.display === display.hidden ? display.visible : display.hidden; desc.display = state; check.display = state;
Close the properties, preview the form, and click the category button twice to check that both fields appear and disappear. Save the PDF and test it in the intended viewer.

Use a Web Form for Reflowing Expandable Sections
Choose a web form when opening a category must push other content down and closing it must reclaim space.
Work with PDF and Office Files in WPS Office
WPS Office is a free, lightweight Office alternative with a familiar interface for working with documents, spreadsheets, presentations, and PDFs. Its format support can make switching from Microsoft Office easier; it does not turn a fixed PDF layout into a dynamically reflowing form.

Frequently Asked Questions
Can an Acrobat PDF form expand and move the fields below it?
A standard Acrobat PDF form has a fixed page layout. You can show or hide form fields, but the surrounding content does not automatically reflow. Use a web form if the page must expand and collapse dynamically.
Can I show or hide fields without JavaScript?
Yes. In a button's Properties > Actions, Acrobat offers a Show/Hide a field action. Configure the action for the fields you want to show or hide; a single-click toggle between both states can be implemented with JavaScript.
Why does my PDF toggle not work in a browser?
Some browser PDF viewers do not fully support Acrobat form JavaScript. Open the saved file in Acrobat or Acrobat Reader and test the button there, then verify compatibility with the viewers your recipients use.
Can a button's rollover or down state expand the form?
No. In button Properties > Options, the Up, Rollover, and Down states change the button's appearance. They do not show other fields or reflow the page by themselves.




