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 validation pass.
Scene:
In the modification page of the organization management, the teller is re
respectively:1, the basic use of methods, through the style set up validation rules
Copy Code code as follows:
When the form is submitted, if you do not fill out the email or the wrong email will be an error, as follows:
The default prompts at the back of the text box can modify Jquery.validate.min.js, find and replace English in Chinese, styles can be changed by CSS class
In the previous article to introduce the jquery validate preliminary Experience (a), this article continues to share the jquery validate related knowledge, to this article interested friends to study quickly.
Just tried the so-called new version of usage. Never ask me how new it is, because I don't know ...
P
Site backstage with the jquery validate framework, the version is jquery Validation Plugin 1.8.1Because it took a long time, the new version has not been updated.Recently the Company Information entry staff have adjusted, no IE11 browser, using IE8 error, error location as follows:No. 688 Line error: name is null.Find a lot of information, finally find the right
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.
", {required:true, min:0,messages:{min: "Please select the type of cooperation"}}); $("#realname"). Rules ("Add", {required:true}); $("#tel"). Rules ("Add", {required:true, mobile:0}); $("#shopname"). Rules ("Add", {required:true}); }And then for what reason the above elements need to be verifiedYou can delete a rulevar remove_user_validate=function() { console.info ("remove_user_validate"); $ ("#province"). Rules ("Remove"); $ ("#city"). Rules ("Remove"); $ ("#area")
Recently when the project encountered a validate plug-in under IE8 Click the Submit button did not perform a check of the bugIn Chrome and FF, there are more than IE9. Baidu has a lot of articles have not found a solution, after their own test to find the problem.Click the Input type=submit button below the IE8 to not trigger the detection. A different way to do it.// compatible with IE8 notation;$ (' #logi
characters", Ismypassword:"Passwords must consist of numbers, English letters and special characters (!,[email protected]#$%^*?_~)"}, Confuserpwd: {required:"Please enter a confirmation password", minlength:"Character length cannot be less than 8 characters", Equalto:"Two times password input inconsistency"}, Userrname: {required:"Please enter your real name", minlength:"Character length cannot be less tha
The 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. The plugin bundles a set of useful validation methods, including URL and email validation, and provides an API
(1) Required:true must be lost field(2) Remote: "check.php" use Ajax method to invoke check.php validate input value(3) Email:true must enter the correct format email(4) Url:true must enter the URL in the correct format(5) Date:true must enter a date in the correct format(6) Dateiso:true must enter the correct format of the date (ISO), for example: 2009-06-23, 19
)) {//Calculate Age varAge =NewIdcard (). Getagebydate (value); $("Input[name= ' age ']"). Val (age); } return true; } Else { return false; }}, "Time format is incorrect");//define where the error prompt appears$.validator.setdefaults ({errorplacement:function(Error, Element) {//error is the wrong prompt object, element is an error component Object if(Element.parent (". Date"). Size () > 0) {error.appendto (E
One, download the dependency packageNET disk Download: Https://yunpan.cn/cryvgGGAQ3DSW access password f224Second, add a separate plugin jquery.validate.messages_cn. js.Change the default prompt mode.Third, jquery form validation plug-in----by the Name property to correlate fields to verify that Officer rules are written into the JS code. for= "Cusername" > Name for= "Cemail" > Email for= "curl" > URL fo
submitted, the browser matches the input to the pattern attribute to determine whether the input is valid.Of course, the validity of the backend validation data is beyond the scope of this issue.
PS just tried again, chrome under when or when type=email type=url , triggered the submission, even if not pattern also will check the
Jquery practice case -- verify email address and jquery case
Let's take a look at all the mailboxes:
It is obviously impossible for us to make judgments by email address.
-A complete Internet email address consists of the following two parts: Logon Name @ host name. in t
This article mainly introduces jquery to verify the email format and display the submit button. The submit button is displayed only when the email address is entered correctly. For more information, see
Brief tutorial
Simple, generous, and intuitive user interfaces are our favorite webpage designs. This article introduces such a design style.
How can we make t
Product Feedback users always enter the wrong email domain name, so the email address obtained by the server is incorrect. For example, there are many users who always input a xxx@qq.com into a xxx@qq.con.
This worries the backend, because the email address is legal, but the error is so obvious (I do not know whether t
This article mainly introduces a practical case of jquery to verify whether the mailbox format is correct, and uses regular expressions for verification. Interested friends can refer to us to see which mailboxes are available:
It is obviously impossible for us to make judgments by email address.-A complete Internet email address consists of the following two p
JQuery uses regular expressions to verify mobile phone numbers, email addresses, ID cards (including Hong Kong, Macao and Taiwan), and jquery Regular Expressions
I have never used the regular expression verification system. I made a demo this time and used it all at once. I will take it directly next time.
The following code uses
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.