Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.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
Javascript HTML&;未显示JS错误(复选框中显示复选框错误)_Javascript_Html_Web - Fatal编程技术网

Javascript HTML&;未显示JS错误(复选框中显示复选框错误)

Javascript HTML&;未显示JS错误(复选框中显示复选框错误),javascript,html,web,Javascript,Html,Web,我正在为实践提供食品配送服务,我要求用户至少选择一种食品。复选框中将显示错误消息: 我想在这里看到错误消息: **错误正在正常工作,但它只是在错误的地方 这是HTML <h2 class="mg-b-15">Type of drinks:</h2><br> <input id="checkboxFT" type="checkbox" value

我正在为实践提供食品配送服务,我要求用户至少选择一种食品。复选框中将显示错误消息:

我想在这里看到错误消息:

**错误正在正常工作,但它只是在错误的地方

这是HTML

            <h2 class="mg-b-15">Type of drinks:</h2><br>
            <input id="checkboxFT" type="checkbox" value="Pepsi" name="type" class="mg-b-15"><span
                class="tx-20">Pepsi</span><br>
            <input id="checkboxPT" type="checkbox" value="Sprite" name="type" class="mg-b-15"><span
                class="tx-20">Sprite</span><br>
            <input id="checkboxI" type="checkbox" value="Apple Juice" name="type" class="mg-b-15"><span
                class="tx-20">Apple Juice</span><br>
            <input id="checkboxII" type="checkbox" value="Orange Juice" name="type" class="mg-b-15"><span
                class="tx-20">Orange Juice</span><br>
            <input id="checkboxIII" type="checkbox" value="Fruit Punch" name="type" class="mg-b-15"><span
                class="tx-20">Fruit Punch</span><br>
错误消息

        type: { // makes user choose drink
            required: 'Please choose a drink'
        },
验证

 $("#personalAndFoodFormId").validate({ // Make sure the user enters the required data
    ignore: "",
    rules: {
        type:       {
            required: true,
            minlength: 1
        },
    },

请检查编辑。您没有说要在何处显示错误。@sergeykuznetsov我希望它位于“饮料类型”的右侧,请选中“编辑”。您可能需要发布更多代码,以便我们提供帮助。看起来您可能正在使用jquery验证?请检查编辑。您好。您没有说要在何处显示错误。@sergeykuznetsov我希望它位于“饮料类型”的右侧,请选中“编辑”。您可能需要发布更多代码,以便我们提供帮助。看起来您可能正在使用jquery验证?
 $("#personalAndFoodFormId").validate({ // Make sure the user enters the required data
    ignore: "",
    rules: {
        type:       {
            required: true,
            minlength: 1
        },
    },