Checkbox JavaScript that toggles spawning of template, or deletion of page.
I'm using the following code as an action to spawn a hidden page template using a checkbox. The JavaScript works, but the issue is that each time I click the check box (check/uncheck) it will spawn a new page. I would like to toggle the checkbox to spawn the template (check) or delete the page (uncheck).
Please note, this will be installed on machines that use Acrobat Reader, though the spawn functionality seems to work just fine.
I am using the following code as an action within each checkbox:
var a = this.getTemplate("TEMPLATE1");
a.spawn(1,false,false);
Thanks for the help! I am very new to coding and acrobat!
