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

Problem with auto tab script with fields with same name.

Darranparsons
Registered: Jul 28 2008
Posts: 5
Answered

I have a several page form all in single digit fields, some fields are named the same as others to repeat information, but this seems to confuse the auto tab script that requires the name of the next field to jump to.

If anyone out there can help I would be most grateful.

My Product Information:
Acrobat Pro 8.1.2, Macintosh
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
In an Acrobat form the fields you see on the page are called Widgets. Two Widgets that have the same name are part of the same logical "Field". Everything that has to do with field level properties is shared between all widgets of a field. Basically anything that is value related, like keystroke and formatting events. Everything that is appearance related is unique for each Widget. Like the border color and mouse events.

If you are using the "field.setFocus()" fucntion you need to acquire a specific Wiget of the field. By itself, the "this.getField()" function acquires the first widget of a field. To get one of the other Widgets you need to append the widget id to the field name.

For Example: for a field named "FirstName" that has 3 widgets on the form

this.getField("FirstName.0"); // Acquires the first Field Widget
this.getField("FirstName.1"); // Acquires the second Field Widget
this.getField("FirstName.2"); // Acquires the third Field Widget


Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

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

Darranparsons
Registered: Jul 28 2008
Posts: 5
Thank you Thomp,

Did the trick, I guess Acrobat numbers these widgets as their propagated not where they are on the page.

Again Thank you.