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

Is it possible to set a field's tooltip via Acrobat Javascript?

kendrew
Registered: Oct 27 2006
Posts: 29

Is it possible to set a field's tooltip via Acrobat Javascript?

My Product Information:
Reader 8, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes, for some odd reason the field object property that represents the tooltip is called "userName".

this.getField("MyField").userName = "This is my field";

This line sets the tooltip for a field named "MyField".

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

AndrewAlb
Registered: Aug 16 2007
Posts: 97
Thom, I tried this several times and every time Adobe crashes and gives me some message about not being able to reference the memory. any tips?
(I copied your example exactly only changing the field name)
I am using Adobe 7 Pro
-thanks.

Andrew D. Albrecht, MS
Solutions Developer
ING USFS

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
This is very strange. Something is very wrong with your Acrobat 7. It should not crash.

First, the answer I gave previously assumed that you are using AcroForms, as opposed to a LiveCycle Designer form. This code will not work at all for LiveCycle forms.

The next thing to do is to break the code into parts and run each part individually from the console window to see what exactly is causing the problem. If it all works from the console then place the same code back into the document with try/catch blocks (and proper error reporting) around each line.

After this you will know much more about what's going on and will be able to write a question with more details.

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