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

Adobe PDF drop down box populates specific text box entry

New Here ,
Feb 10, 2020 Feb 10, 2020

Copy link to clipboard

Copied

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

TOPICS
How to

Views

635

Translate

Translate

Report

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

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

 

Votes

Translate

Translate
New Here ,
Feb 10, 2020 Feb 10, 2020

Copy link to clipboard

Copied

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

 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

 

 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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