Copy link to clipboard
Copied
Hello all,
Thank you in advance to all the helpful people on this forum!
I'm creating a form where users can append additional pages to the end of the document as needed using a dropdown menu that is activated by use of a button which spawns those pages from their templates. Some of those additional pages are different translated versions of the same text. Unfortunately the Russian translation changes the one page letter to a two page. I want users to be able to select "Russian Notification Letter" from the dropdown, click the button, and get both templates that comprise this one document. Below is the script I added to the button. You can see I tried to use the one export value from the dropdown for two different cases, and that didn't work. I've attached that part of the form in question. The drop-down and button are at the bottom.
var sel = this.getField("Notifications").value;
var templateName = "";
switch (sel) {
case 1 : templateName = "Notification Letter";
break;
case 2 : templateName = "Spanish Notification";
break;
case 3 : templateName = "Mandarin Notification";
break;
case 4 : templateName = "Russian Notification 1";
break;
case 4 : templateName = "Russian Notification 2";
break;
}
if (templateName != "") {
var t = this.getTemplate(templateName);
t.spawn();
}
Copy link to clipboard
Copied
You can't have two cases 4, so remove one.
As case 4 use this:
case 4:
var t1 = this.getTemplate("Russian Notification 1");
t1.spawn();
var t2 = this.getTemplate("Russian Notification 2");
t2.spawn();
break;
Copy link to clipboard
Copied
You can't have two cases 4, so remove one.
As case 4 use this:
case 4:
var t1 = this.getTemplate("Russian Notification 1");
t1.spawn();
var t2 = this.getTemplate("Russian Notification 2");
t2.spawn();
break;
Copy link to clipboard
Copied
You're awesome! Worked perfectly. Thank you!

