Contents
Radio buttons don’t participate in constraint validation; they have no real value to be constrained.
The id of each radio button is unique. Each id on a Web page must be unique, and the id elements of each radio button follow those rules. Each radio element also has a name attribute. The name attribute is used to specify the entire group of radio objects.
What should be common with respect to radio buttons?
Radio buttons are normally presented in radio groups (a collection of radio buttons describing a set of related options). Only one radio button in a group can be selected at the same time. Note: The radio group must have share the same name (the value of the name attribute) to be treated as a group.
Is the required attribute required on all radio buttons?
To group radio buttons they must all have the same name value. This allows only one to be selected at a time and applies required to the whole group. Also take note of: To avoid confusion as to whether a radio button group is required or not, authors are encouraged to specify the attribute on all the radio buttons in a group.
You can’t use the required field validator against a radio button but you can use it with a hidden control. Just have your radio button populate the hidden control when it is clicked. That way the validator will fail if the hidden control is never populated.
To group radio buttons they must all have the same name value. This allows only one to be selected at a time and applies required to the whole group.
How can I evaluate the state of my radiobuttons?
You can use the CustomValidator to evaluate the state of radiobuttons. Alternatively, you can choose a third party validation system which greatly enhances your validation toolbox. My Professional Validation And More is one of these and it has a CheckStateValidator (for RadioButtons and CheckBoxes) amongst its 25 validators.