多选的复选框验证

时间:2009-09-07 09:44:16

标签: asp.net vb.net validation

我需要限制用户多次选中复选框,我的asp.net表单中只能选中一个复选框,

我没有使用复选框列表

请帮忙

2 个答案:

答案 0 :(得分:1)

使用类似的东西:

<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>

答案 1 :(得分:0)

使用Javascript。单击CheckBox时调用方法,将CheckBox的ID作为参数,然后取消选中给定上下文中的所有其他Checkbox。

相关问题