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

Populating multiple text boxes with different information based on selection from drop-down box.

New Here ,
Aug 15, 2020 Aug 15, 2020

I'm trying to make certain sections of the pdf auto-fill based on a selection from a drop down box. The problem is that I need a single drop down selection to populate different text boxes with different information. For example:

The drop down box choices are 500, 1000, and 2,000. If I choose 500, I need it to fill in one text box with "500", another with "Five Hundred", a third with "1,000", and a fourth box with "One Thousand". If 1,000 is chosen from the drop-down box it needs to populate a form with "1,000", another with "One Thousand", a third with "2,000", and the fourth with "Two Thousand".

 

I've tried browsing the help section and googling it, but I think I may not be wording the issue correctly.

TOPICS
How to , PDF forms
895
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 15, 2020 Aug 15, 2020

Use this as custom calculation script of your text fields

if(this.getField("Dropdown1").value == "500")event.value = "500";else
if(this.getField("Dropdown1").value == "1000")event.value = "One Thousand";
else event.value = "";

change the names of fields and add values and more lines of codes as you wish,

Also in dropdown field check "commit value immediately".

Repeat in other text fields .

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 16, 2020 Aug 16, 2020
LATEST

Hi,

 

Just a tweak to the above code, if you are constantly using the same field, then it is probably easier to store it, rather than get it every time so something like :

 

var dropDown1Value = this.getField("Dropdown1").value;

if(dropDown1Value == "500") {
    event.value = "500";
} else if(dropDown1Value == "1000"){
    event.value = "One Thousand";
} else {
    event.value = "";
}

 

Regards

 

Malcolm

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