JqueryValidateThe JQuery Validate plugin provides a powerful validation feature for forms, making it easier to validate client forms, while providing a number of customization options to meet the needs of your application.1. First, if we do not have jquery.validata.js, then we need to download it. Click on the god-given download link2. Create the runtime environm
Jquery. validate is a B/S client verification framework based on jquery. With the advantages of jquery, we can quickly verify some common input, greatly improving the development efficiency, the following are my study notes:
Jquery extension
Official Use document: http://jqueryvalidation.org/documentation/Reference: http://www.w3cschool.cc/jquery/jquery-plugin-validate.htmlImport JS files remember to use compressed. Min JS relies on jquery version in 1.11.1 No problem other versions are not tested The HTML structure is made using the thinkphp framework
The JQuery Validate plug-in provides a powerful validation feature for forms, making client form validation simpler, while providing a wide range of customization options to meet the needs of the application. The plug-in bundles a set of useful authentication methods, including URL and email authentication, while providing an API for writing user-defined methods.
jquery Validate has a lot of validation rules, but more often, you need to customize the validation rules for specific situations.
Here's a little chat about the custom validation of jquery validate.
jquery Validate has a method
value.Required: The value of the "#aa: Checked" expression is true, you need to verify.Required:function () {} returns true to indicate that validation is required.There are two types of elements that are commonly used in the form, which need to be filled in or not.Common methods and attention issues 1. Replace the default SUBMIT in other ways$ (). Ready (function () {$ ("#signupForm"). Validate ({
method.If there is only one parameter, write directly, if AF: "A", then A is the only parameter, if multiple parameters, used in [], separated by commas
JqueryValidateSubmit SubmissionSubmithandler: A function that runs after validation, which is added to the form-submitted function, or the form is not submitted$ (". Selector"). Validate ({submithandler:fu
The most common use of JavaScript is the validation of forms, and jquery, as a good JavaScript library, also provides an excellent form validation plug-in----Validation. Validation is one of the oldest jquery Plug-ins and has been validated by a wide variety of projects worldwide, and has been praised by many web developers. As a standard validation method librar
The front end of the recent project uses jquery, and the front end of the form is validated with jquery Validate, which is easy to use and always satisfying.
Some time ago, according to the requirements for the form of the textarea type of elements added HTML Rich Text Edit
By default, the label element is used to display the verification prompt information, and CSS class is added. Through CSS, you can easily set the error control and display mode of error information.
/* Input control verification error */Form input. error {border: solid 1px red ;}
/* Verification error message */Form label. error {width: 200px; margin-left: 10px; color: red ;}
To customize the displa
Validate verification plug-ins, built-in rich validation rules, as well as flexible custom rule interface, HTML, CSS and JS between the low coupling allows you to free layout and rich style, support Input,select,textarea validation.
Description
Browser support: ie7+, Chrome, Firefox, Safari, Mobile Browser
jquery version: 1.7.0+
UsageLoad jquery,
By default, the label element is used to display the verification prompt information, and CSS class is added. Through CSS, you can easily set the error control and display mode of error information.
/* Input control verification error */Form input. error {border: solid 1px red ;}
/* Verification error message */Form label. error {width: 200px; margin-left: 10px; color: red ;}
To customize the displa
Since the Jquery.validate plug-in verification of the same name as input only verify the first, from the StackOverflow to see a lot of ways, the most reliable way is to give the same name of input, generate a different ID, because this dynamic form, is generally artificially generated, so the same name of input assignment different ID is feasible. jquery (' [Id^=qty] '). Each (function(e) {
Jquery validate has many validation rules, but more often, you need to customize the validation rules according to specific circumstances.
Here we will talk about the custom validation of jquery validate.
Jquery validate has a met
Recently the company's projects are used in the jquery validate in the form, feel really very useful, very flexible, very handy. But also encountered a lot of problems. Record it here.
Problem: When submitting a form trigger check, the results of the remote check rule cannot be returned in time, resulting in a validati
By default, the validation prompt is displayed with a LABEL element, and CSS class is added, which makes it easy to set error controls and display the error messages by using CSS.
/* Input Control validation Error *
Form Input.error {border:solid 1px red;}
/* Validation error message * *
form label.error{width:200px;margin-left:10px; color:red;}
If you want to
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.