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. mybatis10--自连接多对一查询

    查询老师对应的所有导师的信息 在09的基础上修改dao和mapper文件 public interface TeacherDao { /** * 根据老师的编号查询所有的导师信息 */ Teacher ...

  2. centos7邮件服务器SSL配置

    在上篇文章centos7搭建postfix邮件服务器的搭建中我们没有配置SSL,接下来我们在这篇文章中讲讲centos7邮件服务器SSL配置. 1. 创建SSL证书 [root@www ~]# cd ...

  3. Spring 注解配置(2)——@Autowired

    版权声明:本文为博主原创文章,如需转载请标注转载地址. 博客地址:http://www.cnblogs.com/caoyc/p/5626365.html  @Autowired 注释,它可以对类成员变 ...

  4. jquery 全选/取消全部

    html /*主要按钮*/ <td><input type="checkbox" id="checkAllChange" /></ ...

  5. python全栈开发 * 11知识点汇总 * 1806011

    一.函数名的运⽤, 第⼀类对象 函数名是⼀个变量, 但它是⼀个特殊的变量, 与括号配合可以执⾏函数的变量 1. 函数名的内存地址def func(fn): print(fn)print(func) # ...

  6. vue问题大全

    什么是 mvvm? MVVM 是 Model-View-ViewModel 的缩写.mvvm 是一种设计思想.Model 层代表数据模型,也可以在 Model 中定义数据修改和操作的业务逻辑:View ...

  7. 图->连通性->关节点和重连通分量

    文字描述 相关定义:假若在删去顶点v以及和v相关联的各边之后,将图的一个连通分量分割成两个或两个以上的连通分量,则称顶点v为该图的一个关节点.一个没有关节点的连通图称为重连通图. 在重连通图上,任意一 ...

  8. lambda用法

    1.lambda为匿名函数,即不用起函数名2.如果函数使用次数很少并且很简洁,一般可以考虑用lambda函数3.lambda可以简化代码的可读性4.lambda不能使用if for等复杂的语法 示例一 ...

  9. bugfree3.0.1-BUG解决方案修改

    该篇内容来自文档“masterBugFree2.pdf”,记录在这里. 1.如何将解决方案改为中文 在\Bugfree\Lang\ZH_CN_UTF-8 \_COMMON.php 文件中做如下修改/* ...

  10. C++提供的四种新式转换--const_cast dynamic_cast reinterpret_cast static_cast

    关于强制类型转换的问题,许多书都讨论过,写的最具体的是C++之父的<C++的设计和演化>. 最好的解决方法就是不要使用C风格的强制类型转换,而是使用标准C++的类型转换符:static_c ...