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

How to use text box with multiple values populate another text box to have different multiple values

New Here ,
Jun 22, 2020 Jun 22, 2020

I need help! 🙂  I'm using Adobe Acrobat Pro DC and am looking for javascript.  I have a text field called "FamilySize" adding  up 2 other text boxes (NumAdults and NumChildren and their sum is the household total which is represented in the "FamilySize" textbox).  I have another text box called "PovGuideline" that I would like to populate with a specific dollar amount dependent on the number being reported in the "FamilySize" text box.  For example, if "FamilySize" reports a value of 2, then I would want "PovGuideline" to report a value of $17,240.  I would like the "PovGuideline" text box to be able to report back a different dollar amount value for up to 12 different amounts.  I hope this makes sense... 🙂  Thank you in advance for any help anyone is able to provide.  

TOPICS
How to , PDF forms
1.2K
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 ,
Jun 22, 2020 Jun 22, 2020

You can do this in a variety of ways using javascript.

 

Personally I am not very knowledgeable in javascript but I use a lot in my PDFs very simple custom calculating scripts; declare variables and then employ conditions to be met using  IF and ELSE IF statements.

 

For example,with my very novice knowledge in javascript this is how I would do it:

 

/* use this as a custom calculating script for the POVGuideline text fild; declare your variable*/

var f = this.getField("FamilySize").valueAsString;

//then your conditional statements

if (f !=="") {

if (a=="2") event.value = "$17,240";
else if  (a=="3") event.value = "$18,240";
esle if (a=="4") event.value = "$19,240";
else if (f=="") event.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
Community Expert ,
Jun 23, 2020 Jun 23, 2020
LATEST

Just a small side-note: It's better to apply the values as pure numbers and then add the formatting (currency symbol, thousands separator, etc.) using the Format tab. If you do it like that you won't be able to use them in further calculations later on, for example if you wanted to sum them all up to get a grand total.

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