Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing a fieldname w/a script

Status
Not open for further replies.

okiiyama

IS-IT--Management
Jan 3, 2003
269
US
I am making a whole bunch of check boxes, and I have made a lot on another pdf I had made, but the names are similar. Essentially the names all like "xx-Something"...I would like to search through all my field names in the new pdf that have "xx" and remove that part of the fieldname. I am a bit new to acrobat and javascripting..I have a script, but my error is that getField("").name is read-only. Here is my script so you can see how I was thinking:

//this would go in a mouse-up action in a button
var fieldname = "";
for(var i = 0; i < this.numFields; i++) {
fieldname=this.getNthFieldName(i);
if(fieldname.substring(0, 2) == "U1") {
//remove "U1" from name
getField(fieldname).name = fieldname.substring(2,99);
}
}

Any advice help would be great
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top