Copy link to clipboard
Copied
I have a multipage form that spawns hidden templates when a single check box is checked. I would like to spawn a different hidden template when two conditions are met. One would be a checkbox and the other based on the value of a cell. I have no idea where to start. Is this possible?
Copy link to clipboard
Copied
Or, can I have hidden templates first unhide with all possible choices and then when the second text field is filled in that it would hide the unwanted templates?
Copy link to clipboard
Copied
Hi @Barbara27752637tepn ,
Are you currently using a script?
If so, do you mind sharing the script?
Both cases are doable, but in my personal opinion I consider the first approach to be the easiest because you can incorporate a custom keystroke script with a condition that evaluates if the desired checkbox is checked, and you may run this custom keystroke script from the textfield where the user input is required.
However, I think that the tricky part is to figure out what do you want the PDF to do if, for example, the chexkbox is cleared or the filled-in data that was entered in the required field is deleted by the user.
In which case, you can instruct an additional condition in that script to handle the removal of the spawned page from the hidden template when such conditions are met.
Copy link to clipboard
Copied
The attached is the form I've developed so far. There are a lot of moving parts. We have to have a client sign a risk disclosure statement if they are wanting to purchase a certain security and it is different disclosure per province. If they click on non-disc (top right side of the page) and then when they select their home province in the address section, that is what needs to trigger the appropriate risk disclosure statement and unhide the template (yet to be made).
Copy link to clipboard
Copied
What is the expected value in the cell (text field)?
Copy link to clipboard
Copied
It would be one of the abreviation of one of the provinces. BC, AB, SK, MB, ON...
Copy link to clipboard
Copied
You can use this as a calculation script in the text field (replace the name of the checkbox):
if (this.getField("CHECKBOX").value != "Off") && event.target.value == "BC" || "AB" || "SK" || "MB" || "ON") {
// Spawning script
}
Copy link to clipboard
Copied
Thank you! I'll give that a try.
Copy link to clipboard
Copied
Actually, there is one more challenge. Not always when the province is selected does it need to have a risk disclosure statement. Only when the checkbox in the top right corner, Non-DISC is checked does a risk disclosure need to be generated and the type is dependant on the province.
Copy link to clipboard
Copied
Sorry. I see where it takes that into account... Oops. My bad
Copy link to clipboard
Copied
You can't use the OR operator like that. You have to specify both parts of the comparison each time, in full.
Alternatively, you can use an array of strings and the indexOf method.
Copy link to clipboard
Copied
Can you provide the statement for me? I'm so new to this that I don't know what an array of string or an indexOf method statement would look like
Copy link to clipboard
Copied
if (this.getField("CHECKBOX").value != "Off" && ["BC", "AB", "SK", "MB", "ON"].indexOf(event.target.value)!=-1) {