TypeError: validator.settings[("on" + event.type)].call is not a function
昨天遇到此错误信息,下面是调试后正确的代码:
$("#inputForm").validate({//inputForm是对应的表单的id
onkeyup:false,
onfocusout:false,
focusCleanup:true,
rules: {
"inputName": { //inputName是要验证的输入框的name
remote:{
type:"POST",
url: "checkTheInput.action",
data:{_iataCode:function(){return $("#inputId").val();}}//inputId是要验证的输入框的id
}
}
},
errorPlacement: function(error, element) {
error.appendTo("#errorDiv");//errorDiv是显示错误信息的div的id
},
messages: {
"inputName": {
remote: "输入的数据不合法!"
}
}
});
如果将"onfocusout:false,"修改为"onfocusout:true,"就会报出上面的错误信息,不过并不影响程序的执行。
上面一段简单的代码已经显示出我们用此段代码的需求(验证表单中的一个输入框中的数据是否合法,用到了jQuery验证中的remote验证),本文主要的目的是为了解释上面的错误因为什么而产生。onfocusout的值默认是true,按理讲写明为true和不写的情况是一直的,不过如果写的话确实会出现上面的错误情况,并且导致“focusCleanup:true,”作用失灵,根本的原因还不晓得需要进一步查证!
1:参考:
http://1.wallwebsite.sinaapp.com/?p=44
2:jQuery验证控件jquery.validate.js使用说明和中文API
http://www.cnblogs.com/hejunrex/archive/2011/11/17/2252193.html
TypeError: validator.settings[("on" + event.type)].call is not a function的更多相关文章
- org.hibernate.validator.constraints.NotBlank' validating type 'java.lang.Integer
使用hibernate时,在save方法时,报了:org.hibernate.validator.constraints.NotBlank' validating type 'java.lang.In ...
- HL7 Event Type
Table 0003 - Event type Value Description A01 ADT/ACK - Admit / visit notification A02 ADT/ACK - Tra ...
- Faiss in python and GPU报错:NotImplementedError: Wrong number or type of arguments for overloaded function 'new_GpuIndexFlatL2'.
最近在玩faiss,运行这段代码的时候报错了: res = faiss.StandardGpuResources()flat_config = 0index = faiss.GpuIndexFlatL ...
- Dynamics 365中计算字段与Now进行计算实体导入报错:You can't use Now(), which is of type DateTime, with the current function.
微软动态CRM专家罗勇 ,回复338或者20190521可方便获取本文,同时可以在第一间得到我发布的最新博文信息,follow me. 计算字段是从Dynamics CRM 2015 SP1版本开始推 ...
- TypeError: Data location must be "memory" for return parameter in function, but none was given.
在用truffle编译智能合约时,报错 TypeError: Data location must be "memory" for return parameter in fu ...
- TypeError: matchExpr[type].exec is not a function
遇到了这个问题,很久没找到答案,后来使用了万能的google,貌似也没找到答案. 详细描述下: 通过使用 $(".select")来选择jqeury对象,没问题. 通过$(&quo ...
- javax.validation.UnexpectedTypeException: No validator could be found for constraint 'org.hibernate.validator.constraints.Length' validating type
使用hibernate validator出现上面的错误, 需要注意: @NotNull 和 @NotEmpty 和@NotBlank 区别 @NotEmpty 用在集合类上面@NotBlank 用 ...
- js Object扩展自定义方法,jQuery抛出 Uncaught TypeError: matchExpr[type].exec is not a function
使用Jquery的时候,想在Object原型上添加自己扩展的方法的时候,启动项目之后,打开网页就会报如上错误信息,经过测试,可以在Object下的具体类型上进行扩展自定义方法,如String,Arra ...
- jQuery.validator 详解二
前言:上一篇详细的介绍了jQuery.validator( 版本v1.13.0 )的验证规则,这一篇重点讲述它的源码结构,及如何来对元素进行验证,错误消息提示的内部实现 一.插件结构(组织方式) 在讲 ...
随机推荐
- SQLite加密的方法(c#)
http://blog.csdn.net/xjbx/article/details/2712236 设置下密码就可以了 http://bbs.csdn.net/topics/380018685 编译为 ...
- 修改mongodb oplog size
转载地址:http://blog.csdn.net/huwei2003/article/details/43307647 修改mongodb oplog size oplog简介: oplog:ope ...
- 黄聪:WordPress 多站点建站教程(六):使用WP_Query、switch_to_blog函数实现获取子站点分类中的文章
首先在你使用主题的funtions.php里面添加下代码: //根据时间显示最新的分类文章内容,每个站点显示一篇内容 //$blog_id 子站点ID //$catid 分类ID wp_reset_q ...
- [转][色彩 A] – 永远不要使用纯黑
原文地址:http://www.cgjoy.com/forum.php?mod=viewthread&tid=110762&extra=page%3D1%26filter%3Dtype ...
- silverlight 报 System.NullReferenceException 未将对象引用设置到对象的实例。
在 Microsoft.Windows.Design.Platform.SilverlightMetadataContext.SilverlightXamlExtensionImplementatio ...
- Makefile Shell 脚本;sed命令
1. 在Makefile中想使用shell脚本,需要添加"@"符号,例如: @if [ -d xxx ]; then \ //-d 判 ...
- 时间c#
无论Time.timeScale 等于多说Update和LateUpdate都会去执行 Time.timeScale会影响FixedUpdate的速度. Time.timeScale还会影响Time ...
- android之Widget01
ExampleAppWidgetProvider.java package com.example.mars_2600_widget01; import android.appwidget.AppWi ...
- 利用 Gitbook 生成文档中心站点
经过一个多月,Bugtags 最近上线了自己的文档站点:docs.bugtags.com,在这里你可以找到 Bugtags 集成.使用相关的绝大部分问题. 在这之前我们使用的是第三方提供的帮助中心产品 ...
- nginx 环境搭建(基于linux)
Nginx是一种服务器软件,故而其最主要.最基本的功能当然是可以与服务器硬件结合,让程序员可以将程序放在Nginx服务器上,将程序发布出去,让成千上万的网民可以浏览.除此之外,Nginx是一种高性能的 ...