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

Show field + checkboxes

RR
Registered: Feb 15 2010
Posts: 7
Answered

I have a form with a lot of checkboxes. I use this code to uncheck boxes and to check boxes. This is the code for 3.28

this.getField("3.20").checkThisBox(0,true);
this.getField("3.24").checkThisBox(0,true);
 
this.getField("3.21").value = "Off";
this.getField("3.22").value = "Off";
this.getField("3.23").value = "Off";
 
this.getField("3.25").value = "Off";
this.getField("3.26").value = "Off";
this.getField("3.27").value = "Off";

You can say I could have used the option Reset form to uncheck.

I want to show a field when 3.20 + 3.24 + 3.28 are checked. Preferable on mouse enter showing and on mouse exit hiding the field.

Any idea?

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
When a field is hidden is does not receive any mouse events. But something you can do is to set all the field's appearance properties to transparent. Then on mouse enter set the appearance values, and on mouse exit remove the appearance values.

As for enabling the button on a specific check box configuration, the best way to do this is with a calculation script on the field itself. Somthing like this:

event.target.readonly = ...Condition... ;

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/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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

RR
Registered: Feb 15 2010
Posts: 7
Thanks Thom,

Had them already on transparent.
As a new bee, I will search in the direction of: event.target.readonly = ...Condition... ;

But ... if anyone has the solution on the shelf? I am glad to take it of.

RR
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The "...Condition..." is a logical expression returning a true/false value. In your code it would be a cobination of [b]this.getField("3.20").isBoxChecked(0)[/b] statements. Making the field readonly deactivates the MouseEnter event so the field cannot be made visible.

the event.target prefix is only used when this code is run from a script on the field you need to make readonly.

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/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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