I’m trying to find an MVC (razor) solution where I can use radio buttons and checkboxes together.
Say there are 2 radiobuttons labelled: All people and Family Members.
If you select the “Family Members” radio button, 3 checkboxes should be enabled: “Employee”, “Spouse”, “Dependant(s)”
The questions are:
- How to group a radio button to 3 checkboxes?
- How to enable the
checkboxes when the related radio button is selected?
Well you could do the following:
Then in your javascript you could do the following:
Then you would need to just define a css class called “hide” and set it display attribute to none. This is just an idea to get you started, hope it helps.