jQuery validator plugin之Validator
Validator.destroy()
Destroys this instance of validator freeing up resources and unregistering events.
jQuery.validator.methods
Object holding all validation methods known to the validator. This can be accessed to override individual methods, while keeping the default messages.
jQuery.validator.addClassRules()
jQuery.validator.addClassRules( name, rules )
jQuery.validator.addClassRules( rules )
- rulesType: ObjectA map of className-rules pairs (see example).
jQuery.validator.setDefaults()
jQuery.validator.setDefaults( options )
- optionsType: ObjectOptions to set as default.
Accepts everything that validate() accepts.
jQuery.validator.format()
One or more arguments can be passed, in addition to the string template itself, to insert into the string.
If you're familiar with the term, this makes this function support currying. If you don't care about that, just use the first argument.
jQuery.validator.addMethod()
Add a custom validation method. It must consist of a name (must be a legal javascript identifier), a javascript based function and a default string message.
jQuery.validator.addMethod( name, method [, message ] )
- nameType: StringThe name of the method used to identify it and referencing it; this must be a valid JavaScript identifier
- methodType: Function()The actual method implementation, returning true if an element is valid. First argument: Current value. Second argument: Validated element. Third argument: Parameters.
- valueType: Stringthe current value of the validated element
- elementType: Elementthe element to be validated
- paramsType: Objectparameters specified for the method, e.g. for min: 5, the parameter is 5, for range: [1, 5] it's [1, 5]
- messageType: StringThe default message to display for this method. Can be a function created by ''jQuery.validator.format(value)''. When undefined, an existing message is used (handy for localization), otherwise the field-specific messages have to be defined.
For simple one-off validation, you can use the bundled pattern
method (in additional methods, source in src/additional/pattern.js
) to validate a field against a regular expression.
In general, it is a good idea to encapsulate those regular expressions inside their own method.
If you need lots of slightly different expressions, try to extract a common parameter.
See also a library of regular expressions.
Validator.showErrors()
Show the specified messages.
Validator.showErrors( errors )
- errorsType: ObjectOne or more key/value pairs of input names and messages.
Validator.resetForm()
Resets the controlled form.
Validator.numberOfInvalids()
Validator.numberOfInvalids( errors )
- errorsType: ObjectOne or more key/value pairs of input names and messages.
Returns the number of invalid fields.
Validator.form()
Validates the form, returns true if it is valid, false otherwise.
jQuery validator plugin之Validator的更多相关文章
- jQuery validator plugin之概要
jQuery validator 主页 github地址 demo学习 效果: Validate forms like you've never validated before! 自定义Valida ...
- jQuery validator plugin 之 custom methods 案例1:multi email
1.add method jQuery.validator.addMethod( "multiemail", function (value, element) { var ema ...
- jQuery Validation Plugin学习
http://blog.csdn.net/violet_day/article/details/14109261 jQuery Validation Plugin Demo 一.默认校验规则 (1)r ...
- (转)jQuery Validation Plugin客户端表单证验插件
jQuery Validation Plugin客户端表单验证插件 官方文档:http://jqueryvalidation.org/documentation/ 官方demo:http://jque ...
- 30个非常流行的提示信息插件(jQuery Tooltip Plugin)
在网站的设计中,提示信息是非常细微的功能,但是起着非常重要的作用.如果你的网站中提示信息做的比较好,会给浏览者留下非常深刻的印象,同时也会起到非常好的网站宣传效果,下面介绍了30个比较流行提示信息插件 ...
- JQuery多媒体插件jQuery Media Plugin使用详解
malsup jquery media plugin 该插件可以播放多种类型的多媒体文件包括:Flash, Quicktime, Windows Media Player, Real Player, ...
- jQuery DataTables Plugin Meets C#
Over the weekend, I was doing some work on the internal CMS we use over at eagleenvision.net and I w ...
- 表单验证的validate.js插件---jQuery Validation Plugin
早上在公交车上看了一个关于慕课网的教程<表单验证的validate.js插件---jQuery Validation Plugin>,正好可以用到自己近期开发简易微博的注册页面和登录页面, ...
- jQuery webcam plugin
jQuery webcam plugin The jQuery webcam plugin is a transparent layer to communicate with a camera di ...
随机推荐
- linux的基本操作(正则表达式)
正则表达式 这部分内容可以说是学习shell脚本之前必学的内容.如果你这部分内容学的越好,那么你的shell脚本编写能力就会越强.所以不要嫌这部分内容啰嗦,也不要怕麻烦,要用心学习.一定要多加练习,练 ...
- mybatis08--关联查询多对一
根据省会的id查询出省会和对应国家的信息 01.多表的连接查询 修改对应的实体类信息 /** *国家的实体类 */ public class Country { private Integer cId ...
- 【C++ 继承与派生/知识梳理】
为什么引入继承派生 代码重用扩充 软件的复用 层次分类 派生类的语法定义 class 派生类名(1):继承方式(2) 基类名(3){ 派生成员声明:} *(1)一个派生类——>多个基类,多继 ...
- vue里在自定义的组件上定义的事件
事件分为原生事件和自定义事件. vue里在自定义的组件上定义的事件,都被认为是自定义事件,必须用$emit()来触发. 这也是子组件向父传值的原理. 如果想作为原生事件,需要在原生事件后面加上.nat ...
- Python学习之旅(三十四)
Python基础知识(33):网络编程(Ⅱ) UDP编程 相对TCP,UDP则是面向无连接的协议 使用UDP协议时,不需要建立连接,只需要知道对方的IP地址和端口号,就可以直接发数据包 虽然用UDP传 ...
- oracle的高级查询
1.简单连接 基本连接语法:SELECT [ALL|DISTINCT]column_name[,expression…]FROM table1_name[,table2_name,view_name, ...
- Cordova打包Apk
======================== apk打包 ======================== keytool -genkey -v -keystore release-key.key ...
- LeetCode 696 Count Binary Substrings 解题报告
题目要求 Give a string s, count the number of non-empty (contiguous) substrings that have the same numbe ...
- GDB调试原理——ptrace系统调用
本文由霸气的菠萝原创,转载请注明出处:http://www.cnblogs.com/xsln/p/ptrace.html 全部关于gdb的文章索引请点这里 引子: gdb基本上大家都在用,你有没有想过 ...
- 20190412 T-SQL语言一
-- T-SQL ------------------------------------------------------ 例如1 什么是注释符 单行注释select *from kc /*sel ...