How to Navigate to a Specific PDF Page Based on Dropdown Selections
Question details
The user needs to configure an interactive PDF so that selecting specific values from two distinct dropdown menus (e.g., Country and Category) automatically jumps the document view to a designated target page.

- Product
- PDF Editor (Adobe Acrobat Pro)
- Device & OS
- not provided
- Scenario
- Building an interactive, conditional PDF form that routes users to different informational pages based on their combined dropdown choices.
- Observed behavior
- The PDF requires a custom script to evaluate the selected values from both dropdowns and map the combination to the correct zero-based page number to trigger the navigation.
Ensure you are using a professional PDF editor that supports form creation and document-level JavaScript execution, and that JavaScript is enabled in your PDF viewer's security preferences.
Use Field-Triggered JavaScript for Page Navigation
Attach a custom JavaScript action to your dropdown fields that calculates the target page based on user selections and updates the document's pageNum property.
In PDF JavaScript, page numbers are zero-based. This means the first page is referenced as pageNum 0, the third page is pageNum 2, and so on. Your script must account for this offset.
To prevent premature navigation, the conditional logic should verify that both the Country and Category dropdowns contain valid, non-default selections before executing the page jump.
Open your PDF in your editor and activate the form editing mode (e.g., 'Prepare Form' in Adobe Acrobat) to view all interactive fields.
Right-click the second dropdown field (the one users will interact with last) and select 'Properties' from the context menu.
Navigate to the 'Actions' tab. Set the 'Select Trigger' to 'On Blur' or 'On Change', set the 'Select Action' to 'Run a JavaScript', and click the 'Add' button.
In the JavaScript editor, define variables to get the current values using this.getField('Country').value and this.getField('Category').value.
Use an if/else or switch statement to evaluate the combinations. When a match is found, assign the correct zero-based integer to this.pageNum (e.g., this.pageNum = 2 to jump to page 3).
Create and Manage Interactive PDF Forms with WPS Office
WPS Office provides a robust, lightweight PDF editor that allows you to seamlessly design fillable forms, insert dropdown menus, and manage PDF pages without requiring complex or expensive software.
- 1. Open Your PDF: Launch WPS Office and open your existing PDF document or create a new one from scratch.
- 2. Access the Form Tab: Click on the 'Form' tab located in the top navigation ribbon to switch to the interactive form editing mode.
- 3. Insert Dropdown Fields: Select the 'Combo Box' tool and draw the dropdown field onto your document, then double-click it to add your list items.
- 4. Save and Test: Click 'Close Form Editing' to return to standard view, test your dropdown selections, and save your document.

Frequently Asked Questions
Why does my PDF script navigate to page 2 when I set pageNum to 1?
PDF JavaScript utilizes zero-based indexing for its page array. The first page is 0, the second page is 1, and so forth. You must always subtract one from the actual page number you want to target in your script.
Can I place the navigation script at the document level instead of on the field?
Yes, you can write a document-level function that handles the navigation logic and simply call that function from the 'Run a JavaScript' action on your dropdown fields. This keeps your code centralized and easier to maintain.
Will this JavaScript navigation work on mobile PDF viewers?
Not consistently. While desktop applications like Adobe Acrobat and WPS Office fully support JavaScript in PDFs, many default mobile PDF viewers or web browser extensions disable custom JavaScript actions for security or performance reasons.




