Skip to main content
claudiav82716487
Known Participant
August 28, 2018
Answered

Adobe Acrobat Pro DC/Dropdown List/Automatically texts in fields

  • August 28, 2018
  • 2 replies
  • 21244 views

Hi! I need help creating a form in adobe Pro Dc. I want to creat a Dropdown List and when the final user select one option in other field will show up a text not editable. For example: If you choose a Country in other field automatically appear the zip code of the country that you chosen. I´ll appreciate your help! I´ve been searching a lot  about this function but I can´t find anything.

Correct answer try67

Yes, and I've replied to it...


In case you didn't get it, here's what I wrote:

You entered the wrong field name in the script... You wrote "Dropdown7" instead of "Dropdown19".

Also, I would recommend to tick the option to commit the selected value immediately, under the drop-down's Properties, Options tab.

Do both things and then try it again.

2 replies

Participant
September 17, 2019

Hi, I am trying a similar code. Issue:when I select productRow1, it overwrites description in ProductDescriptionRow2.

ProductRow1 should populate description in ProductDescriptionRow1 and CostRow1

ProductRow2 should populate description in ProductDescriptionRow2 and CostRow2

 

{var VarDescrip = { AB5645_Q25: {FullDescription: "6 Part Quantity 25", Cost: "6.00" }, AB5650: {FullDescription: "4 Part Quantity 50", Cost: "8.00"}
}};


function SetFieldValues(ProductRow1) {

// Populate fields with values from the Description Data Object
this.getField("ProductDescriptionRow1").value = VarDescrip[ProductRow1].FullDescription;
this.getField("CostRow1").value = VarDescrip[ProductRow1].Cost;
}

function SetFieldValues(ProductRow2) {

// Populate fields with values from the Description Data Object
this.getField("ProductDescriptionRow2").value = VarDescrip[ProductRow2].FullDescription;
this.getField("CostRow2").value = VarDescrip[ProductRow2].Cost;
}

All properties of the 2 dropdowns ProductRow1 and ProductRow2 and the corresponding Description and Cost fileds are the same.

 

Dropdown Custom Keystroke Script 

//SetFieldValues()
if( event.willCommit ) {
if(event.value == " ") this.resetForm(["ProductDescriptionRow1", "CostRow1"]); else SetFieldValues(event.value);
}

Commit selected value immediately - Checked

Thank you very much in advance.  

try67
Community Expert
Community Expert
August 29, 2018

Apply the zip-code as the export value of each item in the drop-down field, and then use this code as the calculation script of the text field:

event.value = this.getField("Name of drop down field").valueAsString;

claudiav82716487
Known Participant
August 29, 2018

Thanks!!! In wich one calculation script? Calculation, validation or accions/ run java script.

Bernd Alheit
Community Expert
Community Expert
August 29, 2018

At calculation.