Copy link to clipboard
Copied
Hi, I am working on a 5 page document that has a checkbox located on page 1 for supplemental information if needed. When CB is selected, it makes template visible. How do I add to the code to put it in the next page (page 2) of the document and not go to the end? Below is the code that is currently in the checkbox. I have searched multiple support threads and tried varies ways to add npage, but seem to be unsuccessful. I am not a JS guru by all means. Any help would be appreciated, thanks in advance!
if(event.target.value!="Off")
{this.getTemplate("Extended").hidden=false;}
else
{this.getTemplate("Extended").hidden=true;}
Use the method spawn.
Copy link to clipboard
Copied
Use the method spawn.
Copy link to clipboard
Copied
Thanks, figured it out!
Copy link to clipboard
Copied
Can you please tell me how you figured it out? This is what I'm trying to do but the answer "use the method spawn" is not very helpful.
Copy link to clipboard
Copied
You should start by learning a bit about writing code.
If you search this forum for the words template and spawn. You'll find many posts that provided example code.
Copy link to clipboard
Copied
Thank you.
Copy link to clipboard
Copied
I have the same question. I can't find anything on method spawn and JS is not my forte. I want this to hidden template to appear after the page with the checkbox/button and not at the end of the document. So I have 3 pages, when button is pressed to show the page template I want it to become page 3 and the original page 3 becomes page 4. I'd greatly help any assistance.
Copy link to clipboard
Copied
Doing it like that is problematic, unless you will only spawn one copy of each page. If you spawn more copies the names of the fields on them will become duplicated, because they are spawned from the same Template and to the same page number. A better solution is to spawn it to the last page, and then move it to the desired location, but that won't work in Reader.
Either way, this is not a simple scripting task. If you have no scripting experience I would recommend you hire a professional to do it for you.