Skip to main content
Participant
December 13, 2022
Answered

How to make a dropdown menu option navigate to a different page in the PDF

  • December 13, 2022
  • 1 reply
  • 3288 views

I would like to know to make a dropdown menu option navigate to a different page in the PDF. I am not proficient in JavaScript and I am not even sure if that is what I would need to use. I cannot find anything on it...

Correct answer try67

it's work fine in dropdown field.. thank you try67

I prefer to  list-box. Is there a way to make it work like dropdown field?


A list-box is a bit trickier. If you do want to use it, enable the option to commit the selected value immediately and use this code under Selection Change:

 

if (!event.willCommit) {
	var selectedValue = event.change;
	if (selectedValue == "text1") this.pageNum = 23;
	else if (selectedValue == "text2") this.pageNum = 23;
	else if (selectedValue == "text3") this.pageNum = 26;	
}

 

1 reply

Nesa Nurani
Community Expert
Community Expert
December 13, 2022

You can do it like this ( as validation script of dropdown field):

if(event.value == "Choice1") this.pageNum = 1;
else if(event.value == "Choice2") this.pageNum = 3;

 

Just keep in mind pages starts with 0, so you always need to set one number lower, for example to go to page 5 set it to 4.

Participant
February 26, 2023

Hi, I was Trying to achieve the exact same but wasnt able. 

I have about 5 items on my dropdown list. WIll the code be the same the first being "if" and remaining 4 being "else if".

 

I was trying I doesnt seem to work on my end? Do I add the code in validate ? Do i need to add anything in the actions tab? Super Thankful. 

 

Best AR

 

Nesa Nurani
Community Expert
Community Expert
February 26, 2023

Can you post the script you tried?