Copy link to clipboard
Copied
I have a fillable form and have created the three buttons listed in the subject. I am having issues with the Add Page button and Clear Page button working the way I need too.
When I click "Add Page" it creates the new page but it copies all the data from the first page.
JavaScript
car a = this.getTemplate ("Name"); a.spawn();
When I click " Clear Page" it clears the entire document not just the page I'm on when I click the button.
JavaScript
if( app.alert({
cMsg: "Are you sure you want to Clear",
cTitle: "Reset Warning",
nIcon: 2,
nType: 2
}) == 4) {
this.resetForm();
}
I am basically attempting to add a new page to the document that is the exact same as the first but is blank. I need the buttons to work independently from page to page only affecting the page the button is on. For example if a user needs to start over on page 5 without having to redo pages 1-4 they can click the button and start over. I have no clue what I'm doing any help would be appreciated.
Copy link to clipboard
Copied
Please refer to the reference for the template.spawn() function:
Note the "bRename" input parameter.
Fields that have the same name have the save value. Id est, if you want unique fields with unique values, they have to be renamed.
Again, for the reset button see the reference for that function. The input argument is an array of fields to be reset.
Fortunately it works with group naming, so you can use the renamed field prefix to reset all the fields on that page.
For example:
this.resetForm(event.targetName.split(".").shift());
This line will reset all renamed fields on a spawned templage page. It only works for this specific condition.