jquery Validate is a common form validation plugin. Encounter a jquery validate form validation does not trigger an issueCurrent wording:$ (function () {$ ("#form"). Validate ({rules: {ThemeColor: {required:true},...},messages: {ThemeColor: {required: ' Required ',},...}});}
This article introduces the jquery validate form verification, mainly uses the Jquery.metadata.js officers transferred Guevara rule to write directly in the class attribute and the definition error message prompt, shares for everybody to refer, the concrete content is as follows
1, add a different plug-in jquery.metadata.js and write the validation rules in the control.2, need to rewrite the way the trigge
Jquery validate usage and extension rules, jqueryvalidateIndex.html
{Required: true, minlength: 5, failed to: '# password'} must be added to metadata. js if you need to use {} in the class.-->Custom Extension-->Jquery. validate. ext. js
// Re-write the prompt jQuery. extend
Some time ago, when jquery. Validate was used, it encountered a tricky problem. jquery. Validate cannot work normally when the remote verification rule was used. The following is a test script:
Script
>
$ (
Function
(){$ (
"
# Form1
"
). Validate ({Rules
The examples in this article describe the 2 ways that the jquery validate plug-in implements AJAX validation duplicates. Share to everyone for your reference, specific as follows:
The jquery validate has been perfected after such years of improvement. It can meet 80% of the verification needs, if the
JQuery validate before using the preparation, need to download the corresponding JS include: 1, Jquery.validate.min.js. 2, Additional-methods.min.js.Of course an essential JS jquery file.The introduction of the above JS began to use, JV (jquery validate hereinafter called JV
jquery Check official website address: http://bassistance.de/jquery-plugins/jquery-plugin-validationFirst, Import JS LibraryNote: Second, the default check rule(1), Required:true must lose field (2), Remote: "remote-valid.jsp" using Ajax method call remote-valid.jsp Validation input value (3), Email:true Must enter the correct for
jquery Check official website address: http://bassistance.de/jquery-plugins/jquery-plugin-validationFirst, Import JS LibraryNote: Second, the default check rule(1), Required:true must lose field (2), Remote: "remote-valid.jsp" using Ajax method call remote-valid.jsp Validation input value (3), Email:true Must enter the correct for
Jquery validate plugin advanced form verification, jqueryvalidate
The validate plug-in provides another method to add verification for a form without changing the HTML of the field. In addition, this plug-in provides a wide range of additional options to control how it works. We pass an object volume to the validate ()
Use the JQuery plug-in validate Remote, jqueryvalidate
JQuery. validate. js is often used in Form Verification. For Beginners, refer to the instructions for using Remote.
1. Basic explanation
JQuery is mainly used for DOM tree and CSS tree retrieval and subsequent operation
Jquery.validate is a validation framework for jquery, with the advantage of jquery, we can quickly verify some of the common input, we can expand our own verification methods, and the internationalization also has a good support
JQuery.validate.js is frequently used in form validation, and is a beginner for remote use.
. Basic explanation
jquery is primarily u
.
Creditcard:true
You must enter a valid credit card number
Equalto: "#field"
The input value must be the same as #field
Accept
Enter a string with a valid suffix name (the suffix of the upload file).
Maxlength:5
Enter a string with a maximum length of 5 (Chinese characters are counted as one character).
Minlength:10
Enter a string with a minimum length of 10 (Chinese characters are counted as one char
JQuery Validate cannot verify the chosen-select Element Solution, jqueryselectchosen
After the chosen-select element executes the chosen () method, it adds style = "display: none;" to the select element to hide it, and re-constructs a drop-down list that looks like select.
By default, jQuery Validate ignores the veri
[Reprint] [jquery. validate] the custom method implements logic verification of "mobile phone number or fixed phone number", jqueryvalidate
In recent project development, the following requirement is met: "Enter at least one mobile phone number or fixed phone number", as shown in:
The jquery. validate. js verification
Basis of jquery validate demo, jqueryvalidate
The jQuery Validate plug-in provides powerful form verification functions to simplify form verification on the client side. It also provides a large number of custom options to meet various application needs. This plug-in is bundled with a set of useful verification methods
JQuery. validate form verification, validateform reset Verification
JQuery verification framework:
Basic html code:
1 2 3 40 4142 html:43
From the above code, I will talk about the use of jQuery Validation.
1. validate (options) is the start of running form. It is used
Use jQueryUIDialog to dynamically generate a dialog box. Use jQuery. validate for verification. MVCControlpublicActionResultCreate () {returnPartialView ();} MVCView code @ modelNetworkGrain. Models. Actionformmethodpo
Use jQuery UI Dialog to dynamically generate a Dialog box and use jQuery.
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.