Jquery 如何检查多个单选按钮选择?
我想使用jquery验证一个问题表单。我的表单如下所示:Jquery 如何检查多个单选按钮选择?,jquery,html,Jquery,Html,我想使用jquery验证一个问题表单。我的表单如下所示: <form id="question_answer_form" action="submit_answers.php" method="post"> <table class="zebra-striped"> <tr> <td >Question 1</td>
<form id="question_answer_form" action="submit_answers.php" method="post">
<table class="zebra-striped">
<tr>
<td >Question 1</td>
<td>
<input type="radio" name="question_answer1" value="1"> Yes
<input type="radio" name="question_answer1" value="0"> No
</td>
</tr>
<tr>
<td >Question 2</td>
<td>
<input type="radio" name="question_answer2" value="1"> Yes
<input type="radio" name="question_answer2" value="0"> No
</td>
</tr>
<tr>
<td >Question 3</td>
<td>
<input type="radio" name="question_answer3" value="1"> Yes
<input type="radio" name="question_answer3" value="0"> No
</td>
</tr>
<tr>
<td colspan="2"><input class="btn success" type="button" value="Submit" id="questions"/></td>
</tr>
</table>
</form>
有什么建议吗?给每台收音机增加一些课程,例如“测试收音机” 然后检查 $(“.test_radio:选中”)。长度>1
为每个收音机添加一些类,例如“test_radio” 然后检查 $(“.test_radio:选中”)。长度>1
jQuery验证插件是一个用于各种表单验证的极好工具。它有各种各样的功能,包括验证多个单选按钮
jQuery验证插件是各种表单验证的绝佳工具。它有各种各样的功能,包括验证多个单选按钮
$("#questions").click(function (e) {
e.preventDefault();
// Check radio button status and notify...;
});