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

Activate 15 Checkup-Boxes with one button ?

hedrich
Registered: Nov 26 2008
Posts: 28
Answered

Hi,
is there a chance to activate 15 Checkup-Boxes with one click on "one" button?
(with a javascript??)

Kind Regards
Holger Hedrich

My Product Information:
Acrobat Pro 9.0, Macintosh
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1875
What do you mean by "activate", exactly? Are you asking about check boxes? Are you using Acrobat or LiveCycle Designer?

George
hedrich
Registered: Nov 26 2008
Posts: 28
Hi George,
sorry for my incorrect description.

Yes, I'm asking about check boxes; after pressing one button all the check boxes (15) should be marked.

I'm using Acrobat Pro for the Mac.

Kind Regards
Holger
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1875
Yes, you can do that with JavaScript. To programmatically select a check box, you need to set the field value to whatever you've specified as the Export value for the check box. For example:

getField("Check1").value = "Yes";
Replace "Yes" with the export value you are using, and "Check1" with the field name you're using. Repeat this statement for the other check boxes.

Note that to uncheck a check box, you need to set the field value to the string "Off", but not "off", false, 0, or anything else.

If you've used a naming scheme such as "Check1", "Check2", ... "Check15", you can use a loop"

for (var i = 1; i < 16; i+= 1) {getField("Check" + i).value = "Yes";}

assuming they all have the same export value.

Note that you can also use the checkThisBox field method, but it was introduced to address a specific circumstance that is somewhat unusual.

George
hedrich
Registered: Nov 26 2008
Posts: 28
Hi George,

thanks for your prompt answer. Everything works fine.

Kind Regards
Holger