How to Use a Checkbox to Navigate to a Specific PDF Page When Checked
Question details
The user wants to set up a PDF form checkbox that navigates to another page only when it is checked, ignoring the action when it is cleared.

- Product
- PDF Editor / Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating interactive PDF forms with conditional page navigation based on a user's checkbox input.
- Observed behavior
- A method is needed to trigger the page navigation script exclusively on the checked state of a checkbox, preventing accidental jumps when unchecking.
Ensure you have a PDF editor that supports JavaScript for interactive form fields. Identify the exact target page you want to navigate to, keeping in mind that PDF scripting uses zero-based page indexing.
Add a Conditional JavaScript to the Checkbox MouseUp Event
Use a simple JavaScript condition on the checkbox's MouseUp action to trigger page navigation only when its value is checked (not 'Off').
In PDF forms, a checkbox can execute an action when clicked. By default, assigning a navigation action directly will trigger it whether the box is being checked or unchecked. To isolate the action to only when the user checks the box, you must evaluate its state using a custom JavaScript.
Open your PDF form in editing mode, right-click the target checkbox, and select Properties from the context menu.
Navigate to the Actions tab in the Properties window. Choose 'Mouse Up' from the Select Trigger dropdown menu.
Choose 'Run a JavaScript' from the Select Action dropdown, then click the Add button to open the JavaScript Editor.
Type the following code: if (event.target.value != "Off") this.pageNum = 9; (Replace 9 with your target page index, which is the actual page number minus one).
Click OK to save the script, close the properties window, and test the checkbox in preview mode to verify it only jumps pages when checked.

Create and Manage Interactive PDF Forms with WPS Office
WPS Office provides robust PDF editing tools, allowing you to easily add checkboxes, text fields, and interactive elements to your documents. Enhance your workflow with lightweight, professional tools.
- 1. Open your PDF in WPS: Launch WPS Office and open your PDF document.
- 2. Access Form Tools: Navigate to the Form tab to reveal interactive form controls.
- 3. Insert Checkboxes: Select the Checkbox tool and click on the desired location to place it.
- 4. Configure Properties: Double-click the newly placed checkbox to configure its properties, appearance, and form logic.

Frequently Asked Questions
Why does my page navigate even when I uncheck the box?
If you assign a navigation action without a conditional statement, any interaction (checking or unchecking) triggers the MouseUp event, causing the page to change. You must use `if (event.target.value != "Off")` to specify the behavior.
How do I find the correct page number index for my JavaScript?
Subtract 1 from the actual page number displayed in your PDF viewer. For example, if you want the user to jump to page 5, you must set the script to use `this.pageNum = 4;`.
Can I use this script to jump to the next page dynamically?
Yes, you can modify the script to advance to the immediate next page instead of a hardcoded page number. Use `if (event.target.value != "Off") this.pageNum++;` in the JavaScript editor.
Do JavaScript form actions work in all PDF readers?
Basic JavaScript for form controls is supported by major PDF editors like Acrobat and WPS Office, but some basic web browsers or built-in mobile PDF viewers might restrict or ignore custom navigation scripts.




