Create a button to remove all buttons in document
Hello, I am attempting to create a form with several fields that the user will fill out and that will have a button that can spawn a additional pages. Each page will have a "Add Page" Button on them. I got that part figured out.
Next I want to create a 2nd button on the first page that will remove all of the buttons including itself, Flatten the document and Save the finalized document so that all the user information typed into the fields is now permeant.
I have attempted to use :
for (i=0; i<this.numFields; i++)
{
var f = this.getField(this.getNthFieldName(i));
if (f.type = "button")
{
this.removeField(this.getNthFieldName(i));
}
}and I also attempted
this.removeField("New Page")
this.remvoeField("Save_Button")So the 2nd code removes the "New Page" button but doesn’t remove it from all of the spawned pages.
but it also fails to remove the "Save_Button" and both codes give the error.
"NotAllowedError: Security settings prevent access to this property method.
Doc.removeField:2:"
Any help would be greatly appreciated.
