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

Widget index for form field

MichaelHansen
Registered: Aug 19 2010
Posts: 6

Hi guys,

Hope you can help me out on this on, I can't seem to find any documentation on it, but hopefully its possible somehow. My problem is that I need to know the widget index of a perticular form field through javascript, is this possible somehow ? To clearify, I would like to know which widget instance of the field myField I currently accessing, is it myField.1 or myField.2. Hope the description is clear enough :)

Cheers,

/m

My Product Information:
Acrobat Pro 9.2, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
What do you mean by "currently accessing"? If you access a widget, then you know which one it is.
If you're just using this.getField("myField"), then you're accessing widget index 0.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

MichaelHansen
Registered: Aug 19 2010
Posts: 6
Hey try67,

Thanks for the prompt reply. By "currently accessing", I meant the field the user is currently typing text into ie. the field that currently has focus.

Cheers,

/m
try67
Expert
Registered: Oct 30 2008
Posts: 2398
What's the trigger for the script? If it's one of the field's actions (keystroke, validate, calculate, format) then you can't, because they only work on the field level.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

MichaelHansen
Registered: Aug 19 2010
Posts: 6
try67 wrote:
What's the trigger for the script? If it's one of the field's actions (keystroke, validate, calculate, format) then you can't, because they only work on the field level.
Yeah, that was what I was afraid of :( The trigger is a validation event of a field. Actually the main problem I'm trying trying to solve with this is that I set the field value via JS, however if the field has focus the new value does not become visible before the field loses focus again. I found out that if you do a setFocus to the field after setting the value the value becomes visible right away. But, I need to set the focus of the right instance (widget) of the field.

Cheers,

/m