Spawning Refreshed Dynamic Templates
I am trying spawn (unlimited times) two blank template pages (upon push of a button) that still leverage the custom field-level javascript that has been developed on the page. Using the following script, it will spawn each template (refreshed), but the field-level custom javascript does not work. Is there a way I can add code to each javascript that will dynamically update the field header when spawned?
Code is as follows:
var NextPageIndex = this.pageNum + 1;
if (event.target.value == "Off")
{
this.deletePages({nStart:NextPageIndex, nEnd:NextPageIndex});
}
else
{
var a = this.getTemplate("User_Page2");
a.spawn(NextPageIndex, true, false);
var PageName = "P"+NextPageIndex;
this.resetForm(PageName);
var a = this.getTemplate("User_Page1");
a.spawn(NextPageIndex, true, false);
var PageName = "P"+NextPageIndex;
this.resetForm(PageName);
}
RefreshPageNumbers();
