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

Adobe PDF drop down box populates specific text box entry

New Here ,
Feb 10, 2020 Feb 10, 2020

I am trying to create a mileage sheet for the various places we have to travel to. I have a drop-down box created with each location. I am trying to have a text box populated with the set mileage and total expense depending upon which location is selected automatically. I have highlighted the fields I am working on. Is this possible? MileageExample.pngexpand image

TOPICS
How to
748
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
New Here ,
Feb 10, 2020 Feb 10, 2020

Disregard found the correct formula...

var selectedPackage = this.getField("Destination").value;
if (selectedPackage=="Total Miles") event.value = "172.4";
else if (selectedPackage=="Total Miles") event.value = "76.2";
else if (selectedPackage=="Total Miles") event.value = "25.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
New Here ,
Feb 10, 2020 Feb 10, 2020

Disregard found the correct formula...

var selectedPackage = this.getField("Destination").value;
if (selectedPackage=="Total Miles") event.value = "172.4";
else if (selectedPackage=="Total Miles") event.value = "76.2";
else if (selectedPackage=="Total Miles") event.value = "25.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
Community Beginner ,
Jan 10, 2022 Jan 10, 2022

Good day, I am trying to do similar thing, and there is a hyperlink within the text. Is there any way to add hyperlink to the website?

 

else if (selectedPackage=="Hose and Strainers") event.richValue = [{text: "ITEM SPECIFICATIONS\n\n", fontWeight: 800},

{text: "3 Inches Hoses • 3 inch Semi Rigid Suction Intake Hose\n"},
{text: " Please visit www.test123.com for details"}

 

 

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 ,
Jan 11, 2022 Jan 11, 2022
LATEST

Here's an article on exactly this topic:

https://acrobatusers.com/tutorials/change_another_field/

 

You'll find some gereral info on scripting dropdowns/lists here:

https://www.pdfscripting.com/public/List-Field-Usage-and-Handling.cfm

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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