JAVA SCRIPT - Creating a new page with same fillable fields and add image options but cleared out!
Need help with creating javascript that allows me to "duplicate" a page that contains fillable fields, drop downs and "add image" feautres but basically "resets" the fields to being empty.
1. I have two action buttons. CLEAR PAGE which contains:
var fieldsNotToReset = ["Text1", "Text10", "Text24", "Radio1", "Dropdown5"]; // Replace with actual field names
var fieldsToReset = [];
for (var i=0; i<this.numFields; i++) {
var fname = this.getNthFieldName(i);
var f = this.getField(fname);
if (f==null) continue;
if (f.type=="button") continue;
if (fieldsNotToReset.indexOf(fname)!=-1) continue;
fieldsToReset.push(fname);
}
this.resetForm(fieldsToReset);var buttonIcon = this.getField("Click here").buttonGetIcon();this.getField("Click here").buttonGetIcon();
this.getField(event.target.name.replace("blank", "Image1")).buttonSetIcon(buttonIcon);
and the 2. ADD PAGE:
var expTplt = getTemplate("88TH RD MAIN PAGE");
expTplt.spawn(numPages,true,false);
IDEALLY, I am able to "ADD PAGE" and create a new page with empty fields and clearing the image however I realize you can not duplicate a page with image fields and remove the images. My main goal is to just duplicate pages and fill in blank fields as you go. Right now the JAVA SCRIPT for add page duplicates all data and the CLEAR PAGE on the duplicated page clears EVERTHING from the entire PDF.
Please help!
