The error location is at the left and right of 92 rows of jquery. metadata. js:Copy codeThe Code is as follows:Else if (elem. getAttribute! = Undefined) {// This line reports an errorVar attr = elem. getAttribute (settings. name );If (attr) data = attr;} The strange thing is that elem is a textarea object, but there is no getAttribute method.Solution: You have successfully modified the code to the following:Copy codeThe Code is as follows: else {Data
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
Easyui The validation box inside the form forms to explain the next Validatebox class and related properties.
Validation rules
Validation rules are defined by using the required and Validtype attributes, and here are the rules that have been implemented:
Email: matching email regular expression rules, system-provided properties.
URLs: matching URL Regular exp
Validate validation methods are sufficient to meet general requirements, and for special requirements you can add custom validation rules using Addmethod (Name,method,message), and the following example adds a method of extended validation for regular expression validation.
$ ("#commentForm"). Validate (): On it, what parameters should be added ...
Registration information authentication text message $ (function () {JQuery.validator.addMethod ("IsMobile", function (value, Element) {var length = Val
Ue.length; return this.optional (Element) | | (length = /^ ((13[0-9]{1}) | ( 15[0-9]{1}) | (18[0-9]{1}))
+\D{8}) $/.test (value)); "Please fill in your phone number correctly."
"); Entry into force $ ("#signup-form"). Validate ({//
("Please enter a value greater than or equal to {0}.") },
Or you can go.
Http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/localization/messages_##.js
The next localized good bag, # #是对应的区域代码, for the celestial, nature is en
Http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/localization/messages_zh.js
PS. Inside is actually
* * Translated default messages for the JQuery validation plugin.
Validate is an excellent form verification plug-in, the initial use of the following methods:(1) front page code:Please enter the following informationUser name: txtUserName"runat=" Server >*E-mail: Txtemail"runat=" Server >*(2) Script code:Jquery.validate.messages_cn.js is used to display the message in Chinese. When writing validation rules, be aware that the control's ID attribute is associated with the rule .j
The symptom is that if two columns of control are displayed in the form, the control on the right is a button on the right with the Combo,combobox, and the width is 100%, the tooltip that is not passed by the validation does not show the correct location as shownOpen the jquery.easyui-1.4.1.min.js about 2575 linesSwitchvar t=$ (_1E4);if (T.parent (). is (' span ') opts.position = = "Left") {left = T.offset ().}else{left = T.offset (). Left + Opts.del
", {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")
JS verifies the number of regular expressions
The code is as follows
Copy Code
function IsTrue (a) {var reg=/^ ([a-z]+[0-9]+) | ( [0-9]+[a-z]+)] [a-z0-9]*$/i;Return Reg.test (a);} function IsNumeric (a){var reg=/^ (-|+) d+ (. d+)? $/Return (Reg.test (a));}Check for positive numbersfunction Isunsignednumeric (a){var reg=/^d+ (. d+)? $/Alert Reg.test (a);}Check whether it is an integerfunction Isinteger (a){var reg=/^ (-|+)? d+$/Return Reg.test (a);}Check if a positive
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
The following code provides a simple demonstration of jQuery Validation, including required items, character length, and format verification.
1. Import files
Ii. Declare HTML fragments
3. error message Style
Iv. Verification Code
Because jquery. validate. js does not have mobile verification, you need to add
First, find messages and add mobile as f
The previous article introduced JS's regular verification method, this one is using jquery to run some of the methods of the exampleJS sectionUser name: Password: Confirm Password: Email: A validation instance method of jquery
100.00");6. Humidity of 0 to 100.00 /^ (\d|[ 1-9]\d|100) (\.\d{1,2})? $/function (value, Element) { returnthis. Optional (Element) | |/^ (\d|[ 1-9]\d|100) (\.\d{1,2})? $/"humidity of 0 to 100.00");7. Please enter an integer greater than 0 or retain three decimal placesfunction (value, Element) { // Enter an integer greater than 0 or leave the three-bit decimal returnthis. Optional ( Element) | | /(^[1-9]{1}[0-9]*$) | (^[0-9]*\. [0-9] {3}$)/"Invoice amount shall not be less than or equa
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.