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 ")
});