【发布时间】:2015-10-15 00:40:35
【问题描述】:
我有 N 组收音机。如果检查了所有无线电组,我想显示一个 div,如果未检查所有组,则显示另一个 div:
HTML
<p>
<input type="radio" name="period" value="1" />1 Year
<input type="radio" name="period" value="2" />2 Years
<input type="radio" name="period" value="3" />3 Years
</p>
<br>
<p>
<input type="radio" name="year" value="1" />2015
<input type="radio" name="year" value="2" />2014
<input type="radio" name="year" value="3" />2013
</p>
<br>
<p>
<input type="radio" name="student" value="1" />Paul
<input type="radio" name="student" value="2" />Mary
<input type="radio" name="student" value="3" />Jane
</p>
<br>
<div class="notchecked">[not all checkboxes are selected yet]</div>
<div class="yeschecked">[submit button]</div>
Javascript
$('.yeschecked').hide();
$('input[type=radio]').click(function () {
$('.yeschecked').show();
});
【问题讨论】:
-
checkbox,我在代码中没有看到任何复选框 -
我的错误。做了收音机,但写了复选框。固定。
-
您真的要检查所有单选按钮吗?
-
^ 每组一张支票,是的。
标签: javascript jquery html validation radio-button