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

Messagebox OK button to clear checkbox

Mitchotron
Registered: Mar 20 2009
Posts: 21
Answered

I have a Javascript that looks at several drop down windows and determines if one specific choice is in any of them. If there are no instances then a message box appears.

if (CamSD.rawValue ==1 && Svideosource1.rawValue !=7 && Svideosource2.rawValue !=7 && Svideosource3.rawValue !=7 &&Svideosource4.rawValue !=7 )
{
xfa.host.messageBox("Please select one S-video source as In Room Camera.", "NO IN ROOM CAMERA SELECTED",1,0)
}

This is an "if" statement triggered by a checkbox (CamSD) being selected. What I want to do is clear the checkbox once the user has clicked OK in the message box.

hcorbin
Registered: Aug 11 2009
Posts: 57
Hi,

The return value of the messageBox() method indicates which button was clicked however since your message box only exposes the OK button there is no need to verify which button was clicked. In this case all you have to do is reset the value of the check box. For example:

if (this.rawValue ==1 && Svideosource1.rawValue !=7 && Svideosource2.rawValue !=7 && Svideosource3.rawValue !=7 &&Svideosource4.rawValue !=7 ){xfa.host.messageBox("Please select one S-video source as In Room Camera.", "NO IN ROOM CAMERA SELECTED",1,0);this.rawValue = 0;}

There is more information about the messageBox method in the Help here:
Scripting > Scripting Reference > Scripting Methods > messageBoxRegards,
Hélène
Mitchotron
Registered: Mar 20 2009
Posts: 21
This works! I thought I tried this already, so I understand the concept (Yay for me), but I must of had a semi in the wrong place.

Thanks so much!