"JQuery" Jquery.metadata.js validation invalidation

Source: Internet
Author: User

<!DOCTYPE HTML><HTML>  <Head>    <Metahttp-equiv= "Content-type"content= "text/html; Charset=ansi"/>    <title>Validation2</title>    <Scriptsrc=".. /scripts/jquery-2.1.3.js "></Script>    <Scriptsrc=".. /scripts/jquery.metadata.js "type= "Text/javascript"></Script>        <Scriptsrc=".. /scripts/jquery.validate.js "type= "Text/javascript"></Script>    <Scripttype= "Text/javascript">      $(function(){                   $("#commentForm"). Validate ({meta:"Validate" });    }); </Script>    <styletype= "Text/css">      *{font-family:Verdana;font-size:96%;}label{width:10em;float: Left;}Label.error{float:None;Color:Red;Padding-left:. 5em;vertical-align:Top;}P{Clear:both;}. Submit{Margin-left:12em;}em{Font-weight:Bold;Padding-right:1em;vertical-align:Top;}    </style>  </Head>  <Body>    <formclass= "Cmxform"ID= "Commentform"Method= "Get"Action="#">      <fieldset>        <legend>A simple example of verifying a comment with a validation hint</legend>        <P>           <label for= "Cusername">Name</label><em>*</em>           <inputID= "Cusername"name= "username"size= "+"class= "{validate: {required:true,minlength:2}}" />        </P>        <P>           <label for= "Cemail">Email</label><em>*</em>           <inputID= "Cemail"name= "Email"size= "+"class= "{validate:{required:true,email:true}}" />        </P>        <P>           <label for= "Curl">Url</label><em>&nbsp;</em>           <inputID= "Curl"name= "url"size= "+"value=""class= "{validate:{url:true}}" />        </P>        <P>          <label for= "Ccoment">Your comments</label><em>*</em>          <textareaID= "Ccoment"name= "comment"cols= "All"class= "{validate:{required:true}}"></textarea>        </P>        <P>           <inputclass= "Submit"type= "Submit"value= "Submit"/>         </P>      </fieldset>    </form>  </Body></HTML>
I JS rookie, today according to book Code, with Jquery.metadata.js to verify, the result has failed. Debugging several times, the code is also checked for consistency, and the discovery is still unsuccessful.    After the great god instruction debugging, finally found the problem. It turns out to be rules "Space"Breaking the curse, when the rule is to be separated by a space, so the rule is not found. Modify the following: And then the result can be out: it seems to take a good look at the source

"JQuery" Jquery.metadata.js validation invalidation

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.