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. Wooden Sticks---(贪心)

    Problem Description There is a pile of n wooden sticks. The length and weight of each stick are know ...

  2. Dev_GridView:设置列为Button

    1. gridview ——run designer ——columns ——columns Edit选择repositoryItemButtonEdit1列 2. 更改colums ——showBu ...

  3. 四则运算第三次 PSP

     

  4. 用java代码解决excel打开csv文件乱码问题

      Java 读取csv文件后,再保存到磁盘上,然后直接用Excel打开,你会发现里面都是乱码. 贴上代码: public class Test { public static void main(S ...

  5. 洛谷P1021邮票面值设计 [noip1999] dp+搜索

    正解:dfs+dp 解题报告: 传送门! 第一眼以为小凯的疑惑 ummm说实话没看标签我还真没想到正解:D 本来以为这么多年前的noip应该不会很难:D 看来还是太菜了鸭QAQ 然后听说题解都可以被6 ...

  6. Hibernate 补充 ManyToOne、OneToMany、OneToOne的使用例

    1.前言      Hibernate 为程序员提供一种级联操作,在编写程序时,通过 Hibernate 的级联功能可以很方便的操作数据库的主从表的数据, 我们最常用的级联是级联保存和级联删除.   ...

  7. SimplifyReader项目(转载)

    项目地址: https://github.com/SkillCollege/SimplifyReader SkillCollege / SimplifyReader 一款基于Google Materi ...

  8. svn 目录

    svn介绍 SVN与Git的区别 SVN服务的模式和多种访问方式 多种访问原理图解与优缺点 SVN安装部署 svn 部署 配置 配置svn用户及密码 配置svn用户及权限 svn 启动命令讲解 svn ...

  9. 关于 ionic3 tabs 导航ico 点击 页面返回顶部

    类似微信 双击 页面返回顶部功能,ionic3 中有一个 Content. 将 import { Content } from 'ionic-angular'; 放入想要实现此功能的 ts中. 实例化 ...

  10. Docker:Docker打包Web API成镜像并上传到Docker Hub(2)

    Docker官方镜像:https://hub.docker.com/: 本文将把一个webapi制作成docker镜像 一.Docker命令 打开Docker Quickstart,有以下常用的命令 ...