Validationengine gives us a lot of work to do with the form validation for the front end. In most cases we use validationengine to validate forms in several ways:
1 Use a normal form submission. This situation validationengine validation does not commit the form.
2 submitt
The previous article introduced the basics of the introduction of jquery validate form validation, detailed in the jquery validate form validation Primer, today's article delves into jquery
Again, the plug-in problem is more, the latter to solve, please do not be vicious. I hope you will put forward good suggestions and good words.
I. Analyzing the basics of form validation
In our web development process, we will encounter a variety of validation. Summed up the basic can be divided into several categories:
(1). required fields [This is very basic]
() restores the previously validated form to its original state before verification /*validator.showerrors ({"FirstName": "I know that your FirstName is Pete, pete!" }); To display custom error messages*/ if(formstate==false){ return; }Else{ //Do someing ... } }) //using AJAX to authenticate, the default is to submit the current validated value to the remote address,
This example describes the simple use of jquery form validation. Share to everyone for your reference, specific as follows:
These days has been doing a form verification page, in order to achieve a friendly interface, deliberately copied the 360buy page, imitation wrote a page
Verify that the Red submit button is displayed
Bindblur:function () {//jquery multilevel authentication form
var n = $ (' #item_name ');
var p = $ (' #price ');
var r = $ (' #reserve ');
Show (Velidate ())//page load after the first validation
//Three need to verify the validation of the binding field
name of the control that the error prompt and validation does not pass6) Validclass (default: ' Valid ')Type: StringDescription: Adds an incoming CSS class to a successful validation control7) errorelement (default value: lable)Type: StringDescription: Tag the wrong div or span or label with a tag8) errorplacement (default: After an invalid element),9) ErrorcontainerType: selector stringDescription: An err
This example describes the jquery implementation form validation code. Share to everyone for your reference. Specifically as follows:The screenshot of the running effect is as follows:
The specific code is as follows:
Directly on the plug-in implementation code, around the code to explain the easier point:
/* Description: A
This article describes the basics of the introduction to jquery Validate form validation, the jquery Validate plug-in provides a powerful validation for forms, makes client form validation
jquery simple Form Validation effect:As long as there is a form of the place, basic will have form validation, the following is a combination of examples of the simplest form
How to use jquery for simple form validation:jquery can be used to form validation, of course, there are more complex forms validation, here is not introduced, the following is a brief introduction of how to use jquery simple
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 provi
triggered when the form is submitted
Example: JQuery Submit () methodWhen submitting a form, a warning box is displayed:
$ ("form"). Submit (function () {
alert ("submitted");
});
Definitions and usageThe Submit event occurs when the form is submitted.This e
This example describes the use of jquery form validation plug-ins in the YII framework. Share to everyone for your reference, as follows:
Run as follows:
View Layer:
Controller (verify Uniqueness):
Verify name Uniqueness Public Function actiononly () { $u _name=yii:: $app->request->get (' u_name '); $login =yii:: $app->db; Query
This article introduces the jquery validate form verification, sharing for everyone's reference, the specific contents are as follows
One, add a different plug-in jquery.validate.messages_cn.js.Change the default prompt.
* * Translated default messages for the JQuery validation plugin.
* LANGUAGE:CN
* auth
It's a good feeling to see the sharp jquery these days. Especially jquery's powerful selector. Use jquery today to write a small case of your own form verification. While consolidating the next jquery. First, the code, of course, is only a small case.Ideas:1, 2. var arrayinput = jQ
Small series of Internet access to a lot of articles on the jquery.validate, the big department just introduced its API and usage, not a detailed introduction to the case, research for half a day or not. To this end, the small make up a jquery validate.js form verification Getting started instance, write is not particularly good, but should apply to beginners, share to everyone.
The following is the Vali
Do project basically inseparable form verification, want to beautiful, concise, not account for memory, user experience effect is goodSo I recommend a JS form verification because I think this is very good, so share the nextThere are also downloaded compression packs under the documentationHttps://github.com/posabsolute/jQuery-
});
In fact, the code is very simple, but it may be because you forget some of the content, so that you can write this code time is very long. Take a note here, a lot of review and consolidation!But in fact, if you use jquery more skillfully, you may find that t
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.