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.setDefaults()

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 ] )

    • name
      Type: String
      The name of the method used to identify it and referencing it; this must be a valid JavaScript identifier
    • method
      Type: Function()
      The actual method implementation, returning true if an element is valid. First argument: Current value. Second argument: Validated element. Third argument: Parameters.
      • value
        Type: String
        the current value of the validated element
      • element
        Type: Element
        the element to be validated
      • params
        Type: Object
        parameters specified for the method, e.g. for min: 5, the parameter is 5, for range: [1, 5] it's [1, 5]
      • message
        Type: String
        The 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.resetForm()

Resets the controlled form.

Validator.numberOfInvalids()

Returns the number of invalid fields.

Validator.form()

Validates the form, returns true if it is valid, false otherwise.

jQuery validator plugin之Validator的更多相关文章

  1. jQuery validator plugin之概要

    jQuery validator 主页 github地址 demo学习 效果: Validate forms like you've never validated before! 自定义Valida ...

  2. jQuery validator plugin 之 custom methods 案例1:multi email

    1.add method jQuery.validator.addMethod( "multiemail", function (value, element) { var ema ...

  3. jQuery Validation Plugin学习

    http://blog.csdn.net/violet_day/article/details/14109261 jQuery Validation Plugin Demo 一.默认校验规则 (1)r ...

  4. (转)jQuery Validation Plugin客户端表单证验插件

    jQuery Validation Plugin客户端表单验证插件 官方文档:http://jqueryvalidation.org/documentation/ 官方demo:http://jque ...

  5. 30个非常流行的提示信息插件(jQuery Tooltip Plugin)

    在网站的设计中,提示信息是非常细微的功能,但是起着非常重要的作用.如果你的网站中提示信息做的比较好,会给浏览者留下非常深刻的印象,同时也会起到非常好的网站宣传效果,下面介绍了30个比较流行提示信息插件 ...

  6. JQuery多媒体插件jQuery Media Plugin使用详解

    malsup jquery media plugin 该插件可以播放多种类型的多媒体文件包括:Flash, Quicktime, Windows Media Player, Real Player, ...

  7. 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 ...

  8. 表单验证的validate.js插件---jQuery Validation Plugin

    早上在公交车上看了一个关于慕课网的教程<表单验证的validate.js插件---jQuery Validation Plugin>,正好可以用到自己近期开发简易微博的注册页面和登录页面, ...

  9. jQuery webcam plugin

    jQuery webcam plugin The jQuery webcam plugin is a transparent layer to communicate with a camera di ...

随机推荐

  1. Spring-Boot 访问Controller时报错可能会是这个坑

    报错信息: 代码: @Controller("/index") public class IndexController extends BaseController{ @GetM ...

  2. python3读文件时报错UnicodeDecodeError: 'gbk' codec can't decode byte 0x9f in position 2: illegal multibyte sequence

  3. Android开发网【申明:来源于网络】

    Android开发网[申明:来源于网络] 地址:http://www.jizhuomi.com/android/video/

  4. windows系统dos下查看无线网密码

    (1)采用命令:netsh wlan show profiles 查看电脑连接过的无线网: (2)采用命令:netsh wlan show profile name ="wifi 名字&qu ...

  5. EFM32G232F64时钟树

    1.为了熟悉MCU的时钟树,先看看EFM32G232F64的CMU(ClockManagementUnit) 时钟管理单元(CMU)用于管控晶振(时钟源)和各个时钟节点.出于降低功耗和启动时间的目的, ...

  6. React时间组件(时分秒补0)页面全局引用

    1.common.js export function formatTime(data){ var d = new Date(data); function doTime(d){ if(d<10 ...

  7. 010 Editor - Binary Templates

        010 Editor是一款非常强大的文本/十六进制编辑器,除了文本/十六进制编辑外,还包括文件解析.计算器.文件比较等功能,但它真正的强大之处还在于文件的解析功能.我们可以使用010Edito ...

  8. 更改linux终端中用户名颜色

    用户名的设置在-下.bashrc文件中,更改PS1变量的值,如果没有就自己加一行 PS1='\[\e[32m\][\u@\h \W]#\[\e[m\] ' 32代表的是绿色前景色,\[\e[m\]是关 ...

  9. GCD(IV)

    死锁:2个任务相互等待造成的. - (void) GCD { NSLog(@"begin"); dispatch_queue_t queue = dispatch_queue_cr ...

  10. 【Spark-core学习之四】 Spark任务提交

    环境 虚拟机:VMware 10 Linux版本:CentOS-6.5-x86_64 客户端:Xshell4 FTP:Xftp4 jdk1.8 scala-2.10.4(依赖jdk1.8) spark ...