Copy link to clipboard
Copied
Hello, I have 4 variations of standard text that needs to be generated based on 4 specific selections within my form.
I will need the selection variables to insert in to certain points of the selected text from dropdown #1.
Dropdown #1 - will determine which of the 4, standard covenant text templates generates.
i.e. (DSCR, Consolidated, Ratio, Single)
Dropdown #2 - will determine frequency, (Annual, Quaterly, Monthly) which will be inserted into text.
Date #3 - This will need to be inserted into the text.
Dropdown #4 - will determine ratio target, will be inserted into text.
A sample generated text will look like this,
(This is a test DSCR paragraph, the frequency will be here ____, the date will be here _____, the target will be here ____.)
I went down the route of writing the command for each scenario but this is time consuming and large!
Any help is appreciated!
Thank you!
Copy link to clipboard
Copied
You can combine the pre-defined text with the values of the fields.
Copy link to clipboard
Copied
You have to concatenate the text string and the values like this:
var dd1=this.getField("Dropdown1").value;
var dd2=this.getField("Dropdown2").value;
var date=this.getField("Date").value;
var dd4=this.getField("Dropdown4").value;
var text=
"This is a test "+dd1+" paragraph, the frequency will be here "+
dd1+",the date will be here "+
date+" the target will be here "+dd4+".";
Change the field names to the actual field names.