Expand my Community achievements bar.

Master check button that automatic checks radio button set

Avatar

Former Community Member
Hi all, I have a question where I have a form with different sections and instead of having the person check every button that does not pertain to their section I have created a "not applicable" checkbox on the top of each section, what do I have to do so that when someone checks the "not applicable" box it automatically checks certain values in the subset below it?
6 Replies

Avatar

Former Community Member
I want to do the same thing. Have a 'Check All' Box - that then checks all of a set of boxes below, that can be indivibually unchecked to customize the choices.



BOX - Choose All



BOX1 BOX2 BOX3

BOX4 BOX5 BOX6



BYW, I don't think you mean radio button set as only one radio button may be selected at a time (you have one option in a group of radio buttons - like a multiple choice test) - they are mutually exclusive. Checkboxes are not - you can do none, one, or multiple selections. But maybe your form is more complex and there are mutiple sets of radio buttons....

Avatar

Former Community Member
You woudl have to write code that woudl check those values for you. You may want to add it to the exit event of the 1st checkbox and do something like this (I am using JavaScript):



if (this.rawValue == "1"){

Checkbox2.rawValue = "1";

CheckBox3.rawValue = "1";

etc .....

} else {

Checkbox2.rawValue = "0";

CheckBox3.rawValue = "0";

etc .....

}



Note that you can control the on/off values .....in my case 1 is on and 0 is off. Also you will probably have to path your way to each of the checkboxes as they will probably not be in the same subform as the original one you are coding from ....so start at the root (form1) and work your way down the hierarchy until you get to your checkbox.



Hope that helps

Avatar

Former Community Member
Hi everyone!I have one question.Please answer me...

I have radiobutton list and print button.I created javascript click event on print button to check some fields if they are or not full.So I check radiobutton list and is going not bad - apears the message box that I didn't use any radio button.But when I used one of them the same message box apeared.So I can't used my print button completely.This is the code:

var indic =0;

if((subform1.RadioButtonList.radio_button1.selectedIndex != null) && (subform1.RadioButtonList.radio_button2.selectedIndex != null))

{

xfa.host.messageBox("Radio buttons were not used!!!","Hei Jude",1);

indic = 1;

}

if(indic==0)

xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 1, 0, 0, 0);

Help me please!

Avatar

Former Community Member
I would suggest that you test the RadioButtonList.rawValue. This will return the value of the button that was selected.



As far as your print not printing put a messageBox just before th eif statement to know what that value of indic is. It might be a string so your statement may need to be if (indic == "0")



Hope that helps

Avatar

Former Community Member
Thanks for reply!

Unfortunately I used RadioButtonsList.rawValue and the same problem appered.