Skip to main content
Participant
February 28, 2024
Question

Spawning a blank template page into form

  • February 28, 2024
  • 1 reply
  • 472 views

Hi Everyone,

 

I am trying to create a form that has a page in that will, on occasion, require more than of that particular form page. It is currently a 3 page document, the middle page is filled out accroding to whats been carried out and sometimes will require another exact page. I have created a button and managed to successfuly use Java to mean when the button is pressed a new copy of the page is spawned from a template. However, I am struggling to get it to spawn as a blank form and not just as a copy of the previous page.

This is the scipt I am using: 

 

var t = this.getTemplate("Addpage");
t.spawn(event.target.page + 1, true, false);
this.resetForm(cPrefix);

Any ideas? 

TIA

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
February 28, 2024

You need to manually reset all the fields on the page after spawning it. Since you know the page number of that new pages a loop can be used to iterate over all the fields in the file, clearing all the ones that are located on that page.