Skip to main content
Participant
September 22, 2021
Question

Drop down lists populates a text box

  • September 22, 2021
  • 1 reply
  • 328 views

I have almost no experience with javascripting, so please make this as simple as possible. My work computer is 2017 Standard and my laptop is DC.

I am creating a form in which I have two drop-down lists and a text box. The first dropdown box is named "Fee Selection" the second dropdown is "Fee Options" and the text box is named "Definition."

I have been able to get the "Fee Options" to be dependent from what is selected from " Fee Selection". But I don't know how to get the text box "Definitions" to reflect the selections and keep it. I have tried some scripts to export the value of the options, but it doesn't stay when I go back to dropdown 1 "Fee Selection."

The options in "Fee Selection" are the following with the 2nd dropdown "Fee Options" depending on the selection in the 1st dropdown.

Fee Selection ------------------------------Fee Options

For accounts less than $50k  ----------1.5% annual fee     .375% per quarter, 1.25% annual fee     .3125% per quarter  

For accounts greater than $50k-------2 Bkpts, 3Bkpts

For accounts greater than $1M-------$1M 2 Bkpts , $5M 2 Bkpts

Fixed Percentage-----------------------0.75% annual fee, 0.5% annual fee, 0.4% annual fee, 0.35% annual fee, .25% annual fee

Flat Rate----------------------------------$ amount, Do Not Bill

 

Once each of these Fee Options are selected, I would like the definition or a blank of each to pop up in the "Definitions" text box. Help.I'm not sure what script to use and where to put them. Thanks in advance.

 

 

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
September 22, 2021

It's not exactly clear what the Definitions field should display, but you can use something like this to do it (as its custom Calculation script):

 

var s1 = this.getField("Fee Selection").valueAsString;
var s2 = this.getField("Fee Options").valueAsString;

if (s1=="For accounts less than $50k" && s2=="1.5% annual fee     .375% per quarter") event.value = "Definition text 1";
else if (s1=="For accounts less than $50k" && s2=="1.25% annual fee     .3125% per quarter") event.value = "Definition text 2";

 

 etc.

Participant
September 22, 2021

This worked very well and I got my definitions implemented. Thank you so much for your help.