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

Activat Checkbox from PulldownMenue

arminius1971
Registered: Jul 15 2008
Posts: 3

Hello,

ißm a new member here and i need some help.

I have a pulldownmenue with 2 or more elements. For each element i have on other sides checkboxes defined. Now i need a script that will activate some checkboxes when a special element from the pulldownmenue is selected.

For Example:
Element 1 will activate checkbox 1
else
element 2 will activate checkbox 2 and deaktivate all other checkboxex...
and so on.

Normaly i define the script in the validatefield, but there is no in the CheckoxFields.

Can someone help me?

Thanks a lot

Armin

My Product Information:
Acrobat Pro 8.1.2, Macintosh
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
A check box value can be set in one of two ways

1. Set it's value property to either it's export value or "Off". The export value is set in the options tab on the properties dialog for the check box

2. User the field fucntion "checkThisBox()"

So here's the scheme:

1. In the Properties dialog for the combobox (i.e., the what you're calling the pulldownmenu) select the "Commit selected value immediately" check box.

2. In the Format tab select "Custom" from the "format Category"

3. Click the edit button on for the "Keystroke" Script and enter this code

   if(event.willCommit){switch(event.value){case "Element1":this.getField("CheckBox1").value = "Yes";break;case "Element2":this.getField("CheckBox2").value = "Yes";break;}}

Depending on how you want this to work you may also want to add code to turn off the other check boxes.

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