Copy link to clipboard
Copied
Hi, I am creating a form that allows users to add additional pages of tables if they need more entry lines. There are several tables in my document that have this feature. I have hidden templates for each table. I was seeing some odd behavior if I clicked the spawn button on the original page, after adding a page (basically scrolling back up to the original page and clicking the spawn button again). I researched a method to hide the button on the original page after I used it once. The spawned template page has the same button (named differently). This has been working, though, after 3 -4 new spawn pages, the button to spawn disappears. I would like to be able to add pages without limit and have the button I press go hidden and the new page show a functioning button. (it works great for the first 3 or 4 pages). Note, I have bRename set to true.
Here is a sample of the code I have on the template page spawn button. I have cut and pasted from other help threads.
//sb is short for spawn button
var sb=event.target.name;
this.getField("Button II All+").display=display.noPrint;
event.target.display=display.hidden;
this.getTemplate ("NewAttorneyPage3") .spawn ({nPage: this.pageNum+1, bRename: true, bOverlay: false});
this.getTemplate ("NewAttorneyPage2") .spawn ({nPage: this.pageNum+1, bRename: true, bOverlay: false});
this.getField("Button II All+").display=display.hidden;
this.getField(sb).display=dispaly.hidden;
this.calculateNow();
//final command is to recalculate page numbers
I think I could us a conditional perhaps, not entirely sure of the syntax.
Have something to add?