Jaison
Jaison

Reputation:

Checkbox validation for multiselection

i need to restrict users selecting check boxes multiple times, only one check box should be seleted in my asp.net form ,

i am not using a checkbox list

Please help

Upvotes: 0

Views: 191

Answers (2)

Olaf
Olaf

Reputation: 10247

Use Javascript. Call a method whenever a CheckBox is clicked that takes the ID of that CheckBox as an argument and then unchecks all other Checkboxes in the given context.

Upvotes: 0

Jacob Rask
Jacob Rask

Reputation: 24368

Use something like this:

<input type="radio" name="foo" value="bar1" id="bar1"> <label for="bar1">Bar One</label>
<input type="radio" name="foo" value="bar2" id="bar2"> <label for="bar2">Bar Two</label>
<input type="radio" name="foo" value="bar3" id="bar3"> <label for="bar3">Bar Three</label>

Upvotes: 1

Related Questions