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

presence of objects

rcwip
Registered: Oct 30 2010
Posts: 13
Answered

Hi there. I want to make two buttons invisible when the saved pdf is open. If either one checkbox is found to be selected, one of the two corresponding buttons will be visible. Apparently, my scripts failed to do so.
 
topmostSubform::docReady - (JavaScript, client)
 
if ((Page8.CheckBox1[0].rawValue == "0") && (Page8.CheckBox1[1].rawValue == "0")) {
this.resolveNode("Page8.Button1").presence = "invisible";
this.resolveNode("Page8.Button1[1]").presence = "invisible";
}
if (Page8.CheckBox1[0].rawValue == "1") {
this.resolveNode("Page8.Button1").presence = "visible";
this.resolveNode("Page8.Button1[1]").presence = "invisible";
}
if (Page8.CheckBox1[1].rawValue == "1") {
this.resolveNode("Page8.Button1[1]").presence = "visible";
this.resolveNode("Page8.Button1").presence = "invisible";
}
Can anyone please advise? Thanks.

Kelly McCathran
Registered: Feb 9 2010
Posts: 38
RC,

I'm a little rusty on my JavaScript, but don't you want to confirm if the checkbox value is true or false:

bInitialValue (optional): If true, the initial state of the checkbox is checked. Default is false.
bAfterValue : When the alert method exits, contains the state of the checkbox when the dialog closed. If true, the checkbox was checked when the alert box is closed.

Kelly McCathran
Adobe Certified Instructor
Adobe User Group Manager (http://creativesuitelovers.com)
Certified Technical Trainer+

iulia
Registered: Jul 14 2011
Posts: 1
Accepted Answer
Write your script in "ready:layout" and it will work