Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

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

New Here ,
Dec 12, 2022 Dec 12, 2022

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...

TOPICS
How to
3.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
2 ACCEPTED SOLUTIONS
Community Expert ,
Dec 12, 2022 Dec 12, 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.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 01, 2025 Sep 01, 2025

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;	
}

 

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 12, 2022 Dec 12, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 26, 2023 Feb 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

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 26, 2023 Feb 26, 2023

Can you post the script you tried?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 28, 2024 May 28, 2024

I am having the same issue:

 

if(event.value == "Page 2") this.pageNum = 1;
else if(event.value == "Page 3") this.pageNum = 2;

else if(event.value == "Page 4") this.pageNum = 3;

else if(event.value == "Page 5") this.pageNum = 4;

 

and so on...

is this correct?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 28, 2024 May 28, 2024

Should work fine, what exactly is the issue you have?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 28, 2024 May 28, 2024

nothing happens when I select a page from the dropdown - the page doesnt change-

also is there a way to hide all other pages when not selected?

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 28, 2024 May 28, 2024

Did you check 'Commit selected value immediately' in dropdown 'Options' tab, and where did you put script?

No, you can't hide other pages.

If you wish your other pages are not seen, you will need another approach by creating templates from those pages and then spawn them depending on dropdown choice using script.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 28, 2024 May 28, 2024

I put the script under the Validate tab and then "run costum validate script"

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 28, 2024 May 28, 2024

I tried this and still nothing happens.

Am i putting the code in the right place?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 28, 2024 May 28, 2024

Yes, the script is in the correct place.

Check console for errors on PC press CTRL+J.

Can you share your file with us?

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 31, 2025 Aug 31, 2025

Hi I created a text box containing

var selectedValue = event.value;
if (selectedValue == "text1") this.pageNum = 24;
else if (selectedValue == "text2") this.pageNum = 24;
else if (selectedValue == "text3") this.pageNum = 27;

However, when I select one of the options, it opens the page I previously selected.

For example, if I select "Text 1" to open page 24,
then select "Text 3", it doesn't open page 27, but page 24.

What is the solution please?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 31, 2025 Aug 31, 2025

Where did you place the code? Under which event? Did you enable the option to commit the selected value immediately, under the field's Properties, in the Options tab?

Also, if you want to jump to page 24 then the value you need to apply to pageNum is 23, as the page numbers in a script are zero-based.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 31, 2025 Aug 31, 2025

thanks for your replay

i creat textbox and place it as shown in the picture 

2025-08-31_16-02-39.gif

 

quote

if you want to jump to page 24 then the value you need to apply to pageNum is 23,.


By @try67

I took that into consideration.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 31, 2025 Aug 31, 2025

That's not a text field, it's a list-box field. Try using a dropdown field, instead, and put the script under the Validation event.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 31, 2025 Aug 31, 2025

thank you very much

i will try dropdown field

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 31, 2025 Aug 31, 2025

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 01, 2025 Sep 01, 2025

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;	
}

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 01, 2025 Sep 01, 2025
LATEST

that work fine @try67  thank you very much

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines