Copy link to clipboard
Copied
Hello everyone!
I need a little help. I have been following the advice in the forum located here -
I have used the advice in the forum and had great results. Recently the buttons have behaved erratically. (new update?)
The add code presented does a brilliant job of insuring the add page button is the last button to be displayed therefore eliminating the possibility of linked fields -
this.getField("Button1").display=display.noPrint; |
however the delete button code has given me errors. (bad parameter) Additionally depending on where i hit the delete button will cause the spawn button to re appear not as the last button on the last page. It will be in addition to the spawn last button on the last spawned page. This can cause the error described with the bRename: true
This has the potential to cause the pages to be linked.
var pg=this.pageNum |
It looks like the fix is this code on the add button -
var sb=event.target.name; |
However it will only show the last page for spawn and delete buttons and will not work for my application.
Is there any way to use a code that will offer the end user to delete any page while keeping the last spawn button only?
For some reason you add 4 pages with the original code and delete the 3rd page you will get a second spawn button.
Any help would be greatly appreciated.
[Question moved to the Acrobat JavaScript forum. -Mod.]
Copy link to clipboard
Copied
It's always recommended to spawn pages as the last pages of the file. Otherwise you might end up with pages that have duplicate fields names, even if you set it up to rename the fields when spawning.
Regarding your issue with deleting pages: The way you're doing it is quite strange. Why are you first moving to the previous page and then delete the original? Why not delete it directly?