问题描述
HTML<formonsubmit="returnSubmit();"><divclass="form-group">@Html.LabelFor(model=>model.Name,htmlAttributes:new{@class="control-labelcol-md-2"})<divclass="col-md-10">@Html.EditorFor(model=>model.Name,new{htmlAttributes=new{@class="form-control"}})@Html.ValidationMessageFor(model=>model.Name,"",new{@class="text-danger"})</div></div>。。。。。。<inputtype="submit"id="Save"value="保存"class="btnbtn-default"/></form><scriptsrc="~/Scripts/jquery.validate.min.js"></script><scriptsrc="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
JSfunctionSubmit(){console.log($("form").valid());}
$("form").valid());这里始终为true无法获取到是否验证通过,求教
解决方案
本帖最后由 u011177580 于 2016-06-21 15:57:17 编辑
解决方案二:
参考
时间: 2024-10-08 05:41:50