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

Deselect check boxes when selecting radio button

DamianM
Registered: Feb 4 2010
Posts: 3
Answered

Hi ,
I have a form with 3 radio buttons and 3 check boxes. If the user clicks any of the radio buttons, I would like to clear any/all of the check boxes that might be selected. If the user clicks any of the check boxes, I would like to clear any radio buttons that might be selected. I have figured out how to clear the radio buttons by using the following code under the check boxes:

this.getField('radiobutton').value = 'Off';

but I can't figure out how to code the radio buttons when clicked to clear the check boxes. Can anyone help please? As you've probably guessed I'm a neub at this.
Thanks, Damian

My Product Information:
Acrobat Standard 9.0, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2399
To uncheck a check box:
var f = this.getField("ChkBox");f.checkThisBox(0,false);

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

DamianM
Registered: Feb 4 2010
Posts: 3
Thank you try67, works a treat.
I also discovered I could achieve the same result by using the "Reset a form" option and selecting on the buttons I wanted to clear. The only pain is if you add any new checkboxes or radio buttons after you do this, the new checkbox/radio button are selected by default in this "reset a form" action - you have to remember go back and unselect those new controls in the "reset a form" action. The better option is to probably us the Java code above.
Cheers, Damian