Use jquery validate with ligerui

Source: Internet
Author: User

In this way, when you click the login button, a small box will pop up on the right side, and the following code error content of jquery extension will be displayed. When the added content is correct, the small box will disappear, and lable will change to error.

$ ("# Form1"). validate ({
ErrorPlacement: function (lable, element ){
Element. ligerTip ({content: lable.html (), appendIdTo: lable });
},
Success: function (lable ){
Lable. ligerHideTip ();
}
});

The following code is extended to enable validator to display Chinese Characters

JQuery. extend (jQuery. validator. messages ,{
Required: "required fields ",
Remote: "Please correct this field ",
Email: "The email format is incorrect ",
Url: "enter a valid url ",
Date: "enter a valid date ",
DateISO: "enter a valid date (ISO ).",
Number: "enter a valid number ",
Digits: "Only integers can be entered ",
Creditcard: "enter a valid credit card number ",
Similar to: "Please enter the same value again ",
Accept: "enter a string with a valid suffix ",
Maxlength: jQuery. validator. format ("a maximum of {0} characters "),
Minlength: jQuery. validator. format ("minimum length: {0} characters "),
Rangelength: jQuery. validator. format ("the length must be between {0} and {1 "),
Range: jQuery. validator. format ("enter a value between {0} and {1 "),
Max: jQuery. validator. format ("enter a maximum value of {0 "),
Min: jQuery. validator. format ("enter a minimum value of {0 ")
});

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.