简体   繁体   English

TypeError:$(…).valid不是函数

[英]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.

相关问题 TypeError:$(…).valid不是jQuery验证中的函数 - TypeError: $(…).valid is not a function in jquery validation jQuery 验证:未捕获的类型错误:$(...).&quot;valid is not a function&quot; with valid references/order - jQuery validate: Uncaught TypeError: $(...)."valid is not a function" with valid references/order 致命错误:未捕获类型错误:call_user_func_array():参数 #1 ($callback) 必须是有效回调 function 未找到或无效 function 名称 - Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback function not found or invalid function name 我正面临一个类型错误:视图函数没有返回一个有效的响应。 该函数要么返回 None 要么在没有返回语句的情况下结束 - I'm facing a TypeError: The view function did not return a valid response. The function either returned None or ended without a return statement 类型错误:&lt;...&gt; 不是函数 - TypeError: <...> is not a function TypeError:$(…)。 不是功能 - TypeError: $(…). is not a function 类型错误:不是函数 - TypeError: not a function TypeError: ... 不是函数 - TypeError: ... is not a function 类型错误:$ 不是函数 - TypeError: $ is not a function 类型错误:这不是 function - TypeError: this is not a function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM