[英]TypeError: $(…).valid is not a function
I am trying to use the validate but it gives me the error valid is not a function 我正在尝试使用验证,但它给我的错误有效不是函数
function Submitform() {
alert("i am here");
if (!$("#MForm").valid()) {
event.preventDefault();
return;
}
}
NB: I am using <script src="~/Scripts/jquery.validate.js"></script>
注意:我正在使用
<script src="~/Scripts/jquery.validate.js"></script>
Here you go with a solution 在这里你有一个解决方案
function Submitform() { alert("i am here"); if (!$("#MForm").valid()) { event.preventDefault(); return; } }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="~/Scripts/jquery.validate.js"></script>
You were missing jQuery core. 您缺少jQuery核心。
Please check in browser network tab whether jquery.validate.js is loading or not. 请在浏览器网络标签中检查jquery.validate.js是否正在加载。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.