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. linux 的基本操作(linux系统的日常管理)

    系统的日常管理 笔者在前面介绍的内容都为linux系统基础类的,如果你现在把前面的内容全部很好的掌握了,那最好了.不过笔者要说的是,即使你完全掌握了,你现在还是不能作为一名合格的linux系统管理员的 ...

  2. oracle编码转换:AL32UTF8->ZHS16GBK

    --修改Oracle数据库字符集为utf-8: SQL>conn / as sysdba; SQL>shutdown immediate; SQL>startup mount; SQ ...

  3. mysql存储emoji问题

    前一段时间,项目中需要在数据库中存储emoji,由于编码格式不对,直接导致数据库报错,后来修改mysql的编码,就解决了 emoji符号实际上是文本,并不是图片,它们仅仅显示为图片 在mysql5.5 ...

  4. python文档-基本API命令翻译及使用方法!

    1.使用tkinter.Tk() 生成主窗口(window=tkinter.Tk()): window.title('标题名')         修改框体的名字,也可在创建时使用className参数 ...

  5. oracle忘记密码用户名被锁定_解决方案

    本方案参考http://www.cnblogs.com/iosundersunshine/p/5313174.html 解决方案(window): 进入cmd命令 按照图上五步,即可 1,输入 ech ...

  6. C/S,B/S的区别

    一.概念说明 C/S(Client/Server(客服机/服务器))架构:客户端/服务器架构.通过将任务合理分配到Client端和Server端,降低了系统的通讯开销,需要安装客服端才可进行管理操作. ...

  7. The way to unwind the stack on Linux EABI

    I. probe the stack frame structure The original idea is to unwind the function call stack according ...

  8. iOS 线程安全--锁

    一,前言 线程安全是iOS开发中避免了的话题,随着多线程的使用,对于资源的竞争以及数据的操作都可能存在风险,所以有必要在操作时保证线程安全. 二,为什么要使用锁? 由于一个进程中不可避免的存在多线程, ...

  9. 【Python全栈-后端开发】Django进阶之Model操作复习

    Django进阶之Model操作复习 一.字段 AutoField(Field) - int自增列,必须填入参数 primary_key=True BigAutoField(AutoField) - ...

  10. Linux Input子系统

    先贴代码: //input.c int input_register_handler(struct input_handler *handler) { //此处省略很多代码 list_for_each ...