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

hyperlink button to take user to a page but to also be dependent on a drop down menu

Explorer ,
Oct 19, 2024 Oct 19, 2024

I'm trying to program a hyperlink button to take user to a page, but I want that button to be dependent on a drop down menu

 

for example, the drop down menu will have options like: page1, page2, page3, etc

and if page1 is selected in the drop down menu, then the "take to page" button will hyperlink to page1,

but if page2 is selected in the drop down menu, then the same "take to page" button will hyperlink to page2, and so on…

 

can this be done?

TOPICS
Create PDFs , JavaScript , PDF , PDF forms
821
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
1 ACCEPTED SOLUTION
Community Expert ,
Oct 19, 2024 Oct 19, 2024

Make the export values of the dropdown selections the zero-based page indices for the dropdown selection.  For example:

page1 /0

page2 /1

page3/2

The numbers after the / are the export values of the dropdown and the text before are the display value.  In the button, enter the following mouse up action:

this.pageNum=this.getField("Dropdown").value;

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 Beginner ,
Oct 19, 2024 Oct 19, 2024

Olá, caso esteja usando o Acrobat Pro na função de "Preparar Formulário", temos a opção de "Lista Suspensa", que gera uma série de opções para resolver a sua dúvida.

Nela você pode adicionar uma opção para cada site que deseja e a pessoa que acessar, podera escolher a opção com o formato de lista suspensa.

Para funcionar, precisa criar a lista suspensa > adiconar os sites nas "Opções" do campo > ajustar "Abrir um link na Web" na opção do campo: "Ações".

casual_magnificenceB82D_0-1729382901063.png
Espero ter ajudado!

 

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 ,
Oct 19, 2024 Oct 19, 2024

Make the export values of the dropdown selections the zero-based page indices for the dropdown selection.  For example:

page1 /0

page2 /1

page3/2

The numbers after the / are the export values of the dropdown and the text before are the display value.  In the button, enter the following mouse up action:

this.pageNum=this.getField("Dropdown").value;

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
Explorer ,
Oct 20, 2024 Oct 20, 2024

Hello again PDF Automation Station! 🙂

I did what you suggested, but the button still doesn’t take me to the page number I put in the export values of the dropdown,

I’m not sure if I did this right,

 

I attached an example PDF of what I’m trying to do 😅

 

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 ,
Oct 21, 2024 Oct 21, 2024

The numbers after the / are the export values. You put export values like this /1 /2 /3.  They should be like this 1 2 3 etc.  Remove the /

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
Explorer ,
Oct 21, 2024 Oct 21, 2024

Ooooh okay, 

 

now it's working, thanks 🙂 

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 ,
Oct 21, 2024 Oct 21, 2024
LATEST

BTW, you don't need the extra button.  You can make this work from the dropdown by entering the following script as a custom keystroke script directly in the dropdown:

 

if(!event.willCommit)
{var page=event.changeEx}
if(event.willCommit)
{this.pageNum=page;}

 

 

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