Skip to main content
Participant
April 21, 2020
Answered

Help spawning Template to the following page checkbox is located with visible/hidden properties.

  • April 21, 2020
  • 2 replies
  • 2393 views

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;}

This topic has been closed for replies.
Correct answer Bernd Alheit

Use the method spawn.

2 replies

Participant
March 14, 2022

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. 

try67
Community Expert
Community Expert
March 15, 2022

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.

Bernd Alheit
Community Expert
Bernd AlheitCommunity ExpertCorrect answer
Community Expert
April 21, 2020

Use the method spawn.

Syn6Author
Participant
April 21, 2020

Thanks, figured it out!

Participant
May 13, 2020

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.