Populating multiple text boxes with different information based on selection from drop-down box.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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 .
Copy link to clipboard
Copied
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

