These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Reference individual properties of duplicate fields

AndrewAlb
Registered: Aug 16 2007
Posts: 97

How do I obtain the unique properties (namely the rect) of two duplicate fields?
I have two duplicate fields in the same form (same name as each other). I need to the rect property for each but I only can get it for one of them. I assume that I have to use the page array in some way to specify which form field I am talking about in my code but I just don't see how to do that without a 'where' clause.
Any help is, as always, appreciated. Thank you.

Andrew D. Albrecht, MS
Solutions Developer
ING USFS

My Product Information:
Acrobat Pro 8.0999999999999996447286321199499070644378662109375, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
In an AcroForm, all fields with the same name are logically the same field. The instances the field on a page are called widgets. Each of a fields widgets can be accessed with a "dot" notation. For example, if there are three text fields named "myname" on a form. The each could be accessed like this.

var fld1 = this.getField("myname.0");
var fld2 = this.getField("myname.1");
var fld3 = this.getField("myname.2");

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script