As mentioned in previous posts, due to version reasons, the "sharp jquery" form verifies that the plug-in part also appears to be out of effect.
1. The introduction of the jquery source file,
2. Introduce the form validation plugin js file,
3. Add "Required" to the class name in the form, "email" and so on as the parameters read when validating.
4. Calling code: $ ("#commentform"). Validate ();
Unfortunately, the error has been made. The front end has a saying is learning new not to learn old, here do not go to the reason, directly provide the latest writing.
1. Open http://code.ciaoca.com/jquery/validation-engine/Download
Step One:
Step:
Step Three:
The box of the two files we need to use, where languages is stored in the language of the configuration files.
2. The introduction of the jquery source file,
3. Introduce the form validation plug-in configuration file,
4. Introduction of form Validation Plug-in (file introduction such as:)
5. Verify the settings and add them directly to the class name. The following is an HTML structure that is rewritten with the latest method, according to the original verification requirements in the book:
<formMethod= "Get"Action="#"class= "Cmxform"ID= "Commentform"> <fieldset> <legend>A simple example of validation with validation hints</legend> <P> <label for= "Cusername">Name</label><em>*</em> <inputtype= "text"ID= "Cusername"name= "username"size= "+"class= "validate[required,minsize[2],maxsize[11]]"> </P> <P> <label for= "Cemail">Email</label><em>*</em> <inputtype= "text"ID= "Cemail"name= "Email"size= "+"class= "Validate[required,custom[email]]"> </P> <P> <label for= "Curl">Url</label><em>*</em> <inputtype= "text"ID= "Curl"name= "url"size= "+"class= "Validate[required,custom[url]]"> </P> <P> <label for= "Ccomment">Your comments</label><em>*</em> <textareatype= "text"ID= "Ccomment"name= "comment"size= "All"class= "validate[required]"></textarea> </P> <P> <inputtype= "Submit"class= "Submit"value= "Submit"> </P> </fieldset> </form>
6. Calling code:
<script> $ (function() { $ ("#commentform"). Validationengine (); }) </script>
In addition, set-up validation can also customize parameters and support chained operations. Interested can self-study-> http://code.ciaoca.com/jquery/validation-engine/
"Sharp jquery" form verification plug-in pit