Copy link to clipboard
Copied
I've been trying to find some information on how to specifically reference a field name on a spawned page. My goal is to have my "spawn button" only displayed on the last page of the document at all times. I have currently have a hidden button on my spawn template, but would like to find a way to make it visible only on the last page (which is a spawned page).
I've been playing around with this tutorial but can't figure out how to make it work for my purposes: https://wordwizardsinc.com/blog/finding-the-fieldname-prefix-on-acrobat-acroform-spawned-template-pa...
Thank you!
Marking this as resolved, I was able to figure it out.
Copy link to clipboard
Copied
Can you find the button?
Copy link to clipboard
Copied
Hi Bernd, I'm not sure I understand the question completely, but I am able to make the button visible and hide it again on the page that it exists on (the template). I'd like to be able to make it visible only the last spawned page though, and am unable to derive the field name for the spawned page so it pops up only on that page.
Thanks again!
Bev
Copy link to clipboard
Copied
Does you spawn the pages with the rename option?
Copy link to clipboard
Copied
yes, they're all being renamed as each form should contain unique information (no duplicates or overwriting)
Copy link to clipboard
Copied
So I played around some more and was able to get it to spawn on the last page using this code:
this.getField("P" + (this.numPages - 2) + ".Template1" + ".Button 1").display=display.visible; this.pageNum=this.numpages-1;
However when I spawn a new page it just stays on that page, and the newly spawned page does not display the button. My intent is to have the button "move" to always only stay on the last page.
My reason for this is to control how the pages get spawned, because if the button is on all pages, and a person spawns from an earlier page, it eventually makes the page numbering wonky and duplicates start to pop up.
Hopefully this all makes sense!
Copy link to clipboard
Copied
So I played around some more and was able to get it to spawn on the last page using this code:
this.getField("P" + (this.numPages - 2) + ".Template1" + ".Button 1").display=display.visible; this.pageNum=this.numpages-2;
However when I spawn a new page it just stays on that page, and the newly spawned page does not display the button. My intent is to have the button "move" to always only stay on the last page.
My reason for this is to control how the pages get spawned, because if the button is on all pages, and a person spawns from an earlier page, it eventually makes the page numbering wonky and duplicates start to pop up.
Hopefully this all makes sense!
Copy link to clipboard
Copied
Marking this as resolved, I was able to figure it out.
Copy link to clipboard
Copied
Please explain what you figured out as it may help other users in the future.
Thank you.