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的基本操作(文本编辑工具vim)
文本编辑工具vim * 命令模式:在一般模式下,输入”:”或者”/”即可进入命令模式.在该模式下,你可以搜索某个字符或者字符串,也可以保存.替换.退出.显示行号等等. 下面笔者教你如何在一个空白文档中 ...
- java基础学习总结——流
一.JAVA流式输入/输出原理
- 网站ASHX不执行故障
今天修改之前做的一个网站,添加了ashx文件,但调试时发现里面的代码不执行. 检查webconfig文件发现其中有一项配置了ashx的处理方式: <system.web> <http ...
- 一个完整的hadoop程序开发过程
目的 说明hadoop程序开发过程 前提条件 ubuntu或同类OS java1.6.0_45 eclipse-indigo hadoop-0.20.2 hadoop-0.20.2-eclipse-p ...
- Codeforces 677 - A/B/C/D/E - (Undone)
链接: A - Vanya and Fence - [水] AC代码: #include<bits/stdc++.h> using namespace std; ; int n,h; in ...
- Java图片合并
/** * 纵向合并图片,ossObject.getObjectContent()返回InputStream对象 */ private BufferedImage mergeImage(List< ...
- 项目实战02:LNMP的搭建、nginx的ssl加密、身份验证的实现
目录 实战一:搭建lnmp及类小米等商业网站的实现 1.安装包,开启服务 2.修改nginx的配置文件 3.修改php-fpm的配置文件 4.运行mysql ,创建一会网页需要的库 5.把事先找好的小 ...
- MAVEN_day02快速入门
一.MAVEN工程目录结构 二.怎么在Eclipse中集成M2E插件(工欲善其事必先利其器)有一些准备工作 1.修改自己下载的MAVEN 2.设置本地仓库 三.构建MAVEN工程 1.选择“MAVEN ...
- 004-mac下Java6与Java8 安装
一.Java6安装 官方下载下载地址:http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-down ...
- [py]一致性hash原理
1,可变,不可变 python中值得是引用地址是否变化. 2.可hash 生命周期里不可变得值都可hash 3.python中内置数据结构特点 有序不可变 有序可变 无序可变 无序不可变 5.一致性h ...