【发布时间】:2012-11-16 10:38:29
【问题描述】:
我有一排这样的单选框
<input id="m_0" type="radio" value="m" name="c_0">
<input id="f_0" type="radio" value="f" name="c_0">
<input id="m_1" type="radio" value="m" name="c_1">
<input id="f_1" type="radio" value="f" name="c_1">
<input id="m_2" type="radio" value="m" name="c_2">
<input id="f_2" type="radio" value="f" name="c_2">
所以,我想验证是否在每一行中都选择了收音机
我试过这种方式 - if ($('input:radio[name="c_"+i]:checked').val()) {
其中 i = 0,1,2... 但它不起作用
知道如何更改它以使其正常工作吗?谢谢。
【问题讨论】:
标签: jquery html validation radio-button