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. hibernate10--命名查询

    <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hiber ...

  2. STL算法总览(部分)

    下图将所有的STL算法(以及一些非标准的SGI STL算法)的名称.用途.文件分布等等,依算法名称的字母顺序列表.表格中凡是不在STL标准规格之内的SGI专属算法,都以 * 加以表示. 注:以下“质变 ...

  3. 实体框架—Entity Framework

    简称EF,是微软以ADO.NET为基础所发展出来的对象关系对应(ORM)解决方案. EF就是用来处理数据的,与数据库打交道.但是底层还是用到了ADO.NET的那一套东西. 为什么叫对象关系对应解决方案 ...

  4. day18:正则表达式和re模块

    1,复习递归:返回值,不要只看到return就认为已经返回了,要看返回操作是在递归的第几层发生的,然后返回给了谁,如果不是返回给最外层函数,调用者就接收不到,需要再分析,看如何把结果返回回来,超过最大 ...

  5. spring和springboot

    Spring四大原则: 1.使用POJO进行轻量级和最小侵入式开发 2.通过依赖注入和基于接口编程实现松耦合 3,.通过AOP和默认习惯进行声明式编程 4.使用AOP和模版template减少模式化代 ...

  6. 检测到包降级: Microsoft.Extensions.Configuration.Abstractions 从 2.1.1 降 2.1.0

    解决方法:工具-nuget管理包-程序管理控制台-选择 项目- 执行 -Install-Package Microsoft.Extensions.Configuration.Abstractions ...

  7. 腾讯云主机及CentOS7.2简单上手体验

    前段时间拜读了崔庆才老师的<Python③网络爬虫开发实战>受益良多,对于初学爬虫的新手来说,本书真可谓是通俗易懂,非常适合新手入门.但是受制于没有服务器环境,书中很多例子难以模拟!最近正 ...

  8. vue-amap | 基于 Vue 2.x 与高德的地图组件

    vue-amap | 基于 Vue 2.x 与高德的地图组件 参考:https://elemefe.github.io/vue-amap/#/

  9. python模块化学习(一)

    import time #获取cpu的时间: #获取本地时间: #获取标准时间格式: #获取时间戳: #print(time.clock()) #这个在3即将被舍弃 print(time.proces ...

  10. [iOS] 测试设备解决自签名证书问题

    不多说,解决过程都是泪. 用了最简单粗暴的方式. 1. 将你的自签名证书,放到测试设备可以访问的站点上 2. 用safari访问上面的地址,直接将证书安装到本设备上 搞掂! Have fun with ...