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

how do I use a drop down menu to link internally

New Here ,
Aug 30, 2016 Aug 30, 2016

I'm using Acrobat Pro DC. I want to use a drop down menu to link internally in my PDF document. I think its possible and the solution is probably with JavaScript. I am very new to JS. I have the drop down created via forms, but nothing I add into the preferences in JS is doing the trick. Any help would be greatly appreciated.

Thank you

TOPICS
Acrobat SDK and JavaScript , Windows
1.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

correct answers 1 Correct answer

Community Expert , Aug 30, 2016 Aug 30, 2016

OK. So first tick the box that says "Commit the selected value immediately" under the drop-down's Properties, Options tab, and then enter this code as its custom validation script:

if (event.value=="A") this.pageNum = 1; // Go to page 2

if (event.value=="B") this.pageNum = 4; // Go to page 5, etc.

Adjust the values and page numbers, as required.

Translate
Community Expert ,
Aug 30, 2016 Aug 30, 2016

Do you mean something like "if item A is selected, go to page 2; if item B is selected go to page 5; etc."?

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 ,
Aug 30, 2016 Aug 30, 2016

Yes exactly

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 30, 2016 Aug 30, 2016

OK. So first tick the box that says "Commit the selected value immediately" under the drop-down's Properties, Options tab, and then enter this code as its custom validation script:

if (event.value=="A") this.pageNum = 1; // Go to page 2

if (event.value=="B") this.pageNum = 4; // Go to page 5, etc.

Adjust the values and page numbers, as required.

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 ,
Aug 30, 2016 Aug 30, 2016

SWEET!

THANK YOU!

I got it to work.

now is there anyway to set the linking to a destination instead of a page number? I'm thinking in terms of flexibility as the destination stays with the page no matter where is gets moved to?

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 ,
Aug 30, 2016 Aug 30, 2016

and I just found the answer. this is after setting destinations in the book mark area thinger... 

if (event.value=="PageB")this.gotoNamedDest("PageC");//go to page 2

try67, thanks ever so much for the help its greatly appreciated!!

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 30, 2016 Aug 30, 2016
LATEST

You got it right! It's just important to realize that Destinations and Bookmarks are not the same thing. Bookmarks can point to destinations, though.

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