Easyui form verification extension (Memorandum)

Source: Internet
Author: User
$. Extend ($. FN. validatebox. defaults. rules, {minlength: {// judge the minimum length validator: function (value, Param) {return value. length> = Param [0] ;}, message: "Enter at least {0} characters. "}, Length: {validator: function (value, Param) {var Len = $. trim (value ). length; return Len> = Param [0] & Len <= Param [1];}, message: "The length of the input content must be between {0} and {1. "}, phone: {// verification phone number validator: function (value) {return/^ (d {2, 3}) | (d {3 }-))? (0d {2, 3}) | 0d {2, 3 }-)? [1-9] d {6, 7} (-d {1, 4 })? $/I. test (value) ;}, message: "The format is incorrect. Use the following format: 020-88888888"}, Mobile: {// verify the mobile phone number validator: function (value) {return/^ (13 | 15 | 18) d {9} $/I. test (value) ;}, message: "Incorrect Mobile Phone Number Format"}, idcard :{// verify ID card validator: function (value) {return/^ d {15} (d {2} [A-Za-z0-9])? $/I. test (value) ;}, message: "Incorrect ID card number format"}, intorfloat :{// verify the integer or decimal validator: function (value) {return/^ d + (. d + )? $/I. test (value) ;}, message: "enter a number and make sure the format is correct"}, currency: {// verify the currency validator: function (value) {return/^ d + (. d + )? $/I. test (value) ;}, message: "incorrect currency format"}, QQ: {// verify QQ, validator: function (value) from 10000) {return/^ [1-9] d {4, 9} $/I. test (value) ;}, message: "Incorrect QQ number format"}, integer: {// verification integer validator: function (value) {return/^ [+]? [1-9] + D * $/I. test (value) ;}, message: "enter an integer"}, Chinese: {// verify the Chinese validator: function (value) {return/^ [u0391-uFFE5] + $/I. test (value) ;}, message: "enter Chinese"}, English: {// verify English validator: function (value) {return/^ [A-Za-Z] + $/I. test (value) ;}, message: "Enter English"}, unnormal: {// verify whether it contains spaces and invalid characters validator: function (value) {return /. +/I. test (value) ;}, message: "The input value cannot be blank or contain other illegal characters"}, Username: {// Verify username validator: function (value) {return/^ [A-Za-Z] [a-zA-Z0-9 _] {5, 15} $/I. test (value) ;}, message: "invalid user name (starting with a letter, 6-16 bytes allowed, letter or digit underline allowed)"}, faxno: {// verify the fax validator: function (value) {// return/^ [+] {0, 1} (d) {1, 3} []? ([-]? (D) | []) {1, 12}) + $/I. test (value); return/^ (d {2, 3}) | (d {3 }-))? (0d {2, 3}) | 0d {2, 3 }-)? [1-9] d {6, 7} (-d {1, 4 })? $/I. test (value) ;}, message: "incorrect fax number"}, ZIP: {// verify the zip code validator: function (value) {return/^ [1-9] d {5} $/I. test (value) ;}, message: "Incorrect zip code format"}, IP: {// verify IP address validator: function (value) {return/d +. d +. d +. d +/I. test (value) ;}, message: "Incorrect IP address format"}, name: {// verification name, which can be Chinese or English validator: function (value) {return/^ [u0391-uFFE5] + $/I. test (value) |/^ W + [WS] + W + $/I. test (value) ;}, message: "Enter Name "}, carno: {validator: function (value) {return/^ [u4E00-u9FA5] [Da-Za-Z] {6} $ /. test (value) ;}, message: "invalid license plate number (e.g. Guangdong j12350)"}, carenergin: {validator: function (value) {return/^ [a-zA-Z0-9] {16} $ /. test (value) ;}, message: "The engine model is invalid (for example, fg6h012345654584)"}, email: {validator: function (value) {return/^ W + ([-+.] W +) * @ w + ([-.] W + )*. W + ([-.] W +) * $ /. test (value) ;}, message: "enter a valid email account (for example, [email protecte D]) "}, MSN: {validator: function (value) {return/^ W + ([-+.] W +) * @ w + ([-.] W + )*. W + ([-.] W +) * $ /. test (value) ;}, message: "enter a valid MSN account (for example, [email protected] (MSN/live ). com) "}, same: {validator: function (value, Param) {if ($ (" # "+ Param [0]). val ()! = "" & Value! = "") {Return $ ("#" + Param [0]). val () = value ;}else {return true ;}, message: "The two passwords are inconsistent! "}});

 

Easyui form verification extension (Memorandum)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.