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

Javascript that creates a new field that will have that fields visibility display or not display.

saj
Registered: Oct 15 2008
Posts: 52
Answered

Below is essentially what I want to do. I want to have a button that will create a field. This field will have a javascript to make another field visible when mouse rolls into it and hidden when the mouse rolls out of it. I'm missing something with my formula. Can someone help me.
thanks,
sj
 
var btn=this.addField("Word","button",
page = this.pageNum, [231,558,576,620]);
btn.userName = "Glossary";
btn.delay=true;
btn.setAction("MouseEnter", "this.getField("Button 8").display = display.visible;" );
btn.setAction("MouseExit", "this.getField("Button 8").display = display.hidden;" );
btn.display = display.visible;
btn.highlight='push';
btn.fillColor=color.transparent;
btn.delay=false;

My Product Information:
Acrobat Pro 9.4.3, Macintosh
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
Accepted Answer
Have you checked the Acrobat JS debugging console for errors?

When I try to run your code in the JS debugging console, I get the following error:

missing ) after argument list
4:Console:Exec
undefined

It appears this error is a result of trying to put a double quotation mark with a string delimited by double quotation marks. You either need to use a different type of quotation marks or use the JavaScript escape character to indicate the double quota ion mark is a special character and does not indicate the end of the quoted string.

George Kaiser