Jquery validate verifies the File Upload type
Because jquery validate is used by the project development to verify the uploaded files, it is found that the built-in verification function is rich and easy to use. However, some MIME files are not frequently used and are not easy to view.
For this example, see w3cschool.
JQuery Validate UseScriptsrc= "Js/b/js/jquery.validate.js">Script>styletype= "Text/css">Input.error{Border-color:#a94442!important;Box-shadow:inset 0 1px 1px rgba (0,0,0,.075), 0 0 8px #a94442!important;}Label.error{Padding-left:16px;Padding-bottom:2px;Font-weight:Bold;Color:#EA5200;}When the form is submitted, it will verify itself;JQuery
Self-organizing a few jquery. Validate Verify the Regular:1. Enter only numbers and letters /^[0-9a-za-z]*$/gJQuery.validator.addMethod ("Letters", function (value, Element) { return this.optional (Element) | |/^[0-9a-za-z]* $/g.test (value);}, "Only enter numbers and letters!");2. The quantity must be a positive integer /^\+?[ 1-9]\d*$/JQuery.validator.addMethod ("Count", function (value, Element) {
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. All bundled methods use English as an error
Recently, the jQuery. validate. js plug-in is required for the project, so you can record some of your work experience for future study.
[Example]
1. Foreground page
2. Javascript
3. background processing program
Public void ProcessRequest (HttpContext context) {context. response. contentType = "text/plain"; string action = context. request ["action"]; // obtain the username and custom parameter string na
This article mainly introduces jquery and CSS to use validate for beautiful verification, if you need it, you can refer to the verification function that you have integrated online with the beautiful Tips for verification.
Hover your mouse over-yungo.com-goldapple's blog
They are:1. Basic usage: set verification rules through stylesCopy codeThe Code is as follows: When a form is submitted, an error occurs if no email is entered or the email is incorrect, as shown below:
The default prompt after the text box indicates that jquery can be modified. validate. min. js. Search for and replace the style with Chinese. The style can be changed through the css class style, as shown i
I made a mistake. Don't you know?
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
View the HTML code:
Clientid corresponds to ID and uniqueid corresponds to name. jquery validate uses name verification.Correct:
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
For debugging, you can add Debug: true first.
Jquery uses validate in combination with CSS to implement beautiful verification. jqueryvalidate
I have combined the verification functions I found on the Internet with the beautiful tips. I hope you will like the verification.
Isn't it very beautiful? You can also beautify your friends according to your own requirements. I hope my friends will like it.
)) {//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 (Element.parent (). parent ()); } Else{element.
Take the following text box as an example,typeid= "username"/>We want this text box to enter only numbers, then the corresponding rules should be set Username:number,However, when the user does something, we do not need this validation rule, the specific implementation is as follows:First, regardless of whether the validation needs to be canceled, we add it to the initialization.After the user has done something, the validation rule needs to be canceled:1 $ ("#username"). Rules ("Remove", "numbe
This article is mainly on the jquery Validate validation, validation rules written in the control of the specific example of the introduction, the need for friends can come to the reference, I hope to help you. Officers transferred Guevara rules are written to the control nbsp; nbsp; code as follows: ; nbsp; nbsp; Tips: Using class= "{}", you must introduce the package: Jquery.metadata.js nbsp; You can us
This article introduces the jquery plug-in validate to implement the custom checksum result style detailed code, shares for everybody reference, the concrete content is as follows
The effect is as follows:
Specific steps:
1, the introduction of the dependency package
2, add error style
Em.error {
Background:url ("images/unchecked.gif") no-repeat 0px 0px;
padding-left:16px;
}
Defining Chinese messagesvar cnmsg = {Required: "Required field",Remote: "Please fix this field",Email: "Please enter the correct format of e-mail",URL: "Please enter a valid URL",Date: "Please enter a valid date",Dateiso: "Please enter a valid date (ISO).",Number: "Please enter a valid digit",Digits: "Can only enter integers",CreditCard: "Please enter a valid credit card number",Equalto: "Please enter the same value again",Accept: "Please enter a string with a valid suffix name",Maxlength:jQuer
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 to write user-defined methods. All bundled me
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.