I am creating a form that has some pages which are optional based on user's needs. I've figured out how to place buttons that will spawn those additional pages based on embedded templates; however, I also want to have buttons that will hide said pages again in case someone adds one in error. The script I used in the buttons to add the pages is this:
var a = this.getTemplate ("Interview notes");
a.spawn();
I tried using this script in a "Remove Page" button...
var currentPageNumber = this.pageNum;
this.deletePages({nStart: currentPageNumber, nEnd: currentPageNumber});
...but unfortunately it deletes the whole page template meaning that the add page button no longer does anything within that version of the file.
I also tried the following:
Add page-
var t = this.getTemplate ("Interview notes");
t.hidden=false
And this for the remove page button:
var t = this.getTemplate("Interview notes");
t.hidden=true
This worked beautifully... until I opened the file in Acrobat Reader rather than Pro, and then it didn't work at all (all template pages were visible all the time).
Basically, I need something that does the opposite of the "spawn" command, and gets that template back to a hidden state without removing it entirely, and works in Adobe Reader.
Thank you!
var a = this.getTemplate ("Interview notes");
a.spawn();
I tried using this script in a "Remove Page" button...
var currentPageNumber = this.pageNum;
this.deletePages({nStart: currentPageNumber, nEnd: currentPageNumber});
...but unfortunately it deletes the whole page template meaning that the add page button no longer does anything within that version of the file.
I also tried the following:
Add page-
var t = this.getTemplate ("Interview notes");
t.hidden=false
And this for the remove page button:
var t = this.getTemplate("Interview notes");
t.hidden=true
This worked beautifully... until I opened the file in Acrobat Reader rather than Pro, and then it didn't work at all (all template pages were visible all the time).
Basically, I need something that does the opposite of the "spawn" command, and gets that template back to a hidden state without removing it entirely, and works in Adobe Reader.
Thank you!