Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.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 EditorFor复选框始终返回false_Jquery_Checkbox - Fatal编程技术网

Jquery EditorFor复选框始终返回false

Jquery EditorFor复选框始终返回false,jquery,checkbox,Jquery,Checkbox,HTML: <div class="editor-label"> <%: Html.LabelFor(model => model.IsFeatured)%> </div> <div id="IsFeatured" class="editor-field textbox"> <%: Html.EditorFor(model => model.IsFeatured)%> <%: Html.V

HTML:

   <div class="editor-label">
    <%: Html.LabelFor(model => model.IsFeatured)%>
</div>
<div id="IsFeatured" class="editor-field textbox">
    <%: Html.EditorFor(model => model.IsFeatured)%>
    <%: Html.ValidationMessageFor(model => model.IsFeatured)%>
为什么即使选中复选框,我也总是得到false

   <div class="editor-label">
    <%: Html.LabelFor(model => model.IsFeatured)%>
</div>
<div id="IsFeatured" class="editor-field textbox">
    <%: Html.EditorFor(model => model.IsFeatured)%>
    <%: Html.ValidationMessageFor(model => model.IsFeatured)%>

   <div class="editor-label">
    <%: Html.LabelFor(model => model.IsFeatured)%>
</div>
<div id="IsFeatured" class="editor-field textbox">
    <%: Html.EditorFor(model => model.IsFeatured)%>
    <%: Html.ValidationMessageFor(model => model.IsFeatured)%>
因为
#IsFeatured
是一个div而不是一个复选框try

   <div class="editor-label">
    <%: Html.LabelFor(model => model.IsFeatured)%>
</div>
<div id="IsFeatured" class="editor-field textbox">
    <%: Html.EditorFor(model => model.IsFeatured)%>
    <%: Html.ValidationMessageFor(model => model.IsFeatured)%>
var IsFeatured = $('#IsFeatured input[type="checkbox"]').is(':checked');