Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 如何检查多个单选按钮选择?_Jquery_Html - Fatal编程技术网

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>

我想使用jquery验证一个问题表单。我的表单如下所示:

       <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...;
    });