Copy link to clipboard
Copied
I am working on an inventory list that is 2 pages. The second page I want to be optional so I decided to use JavaScript (for spawning). I applied this script to my button and it does work. My issue is I only want it to spawn the document once. At this time the button spawns the same document multiple times.
var expTplt = getTemplate("P0Inventorylist");
expTplt.spawn(numPages,false,false);
I only want the user to be able to pull this one time if additional lines are needed. What is the coding I would add to the one above that will limit the user to only pulling this one time?
Add this to the end of the code:
event.target.display = display.hidden;
If the button is on the page that is getting spawned then add a command to hide the spawned copy, as well, like this:
this.getField("Name of spawned button").display = display.hidden;
Copy link to clipboard
Copied
Add this to the end of the code:
event.target.display = display.hidden;
If the button is on the page that is getting spawned then add a command to hide the spawned copy, as well, like this:
this.getField("Name of spawned button").display = display.hidden;
Copy link to clipboard
Copied
Thanks for this. It worked like a charm!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now