Bug encountered in jquery Verification Form

Source: Internet
Author: User

// Today, I encountered a bug in code writing, which made me depressed. I found a lot of people who didn't make it all out for me. I tested the teacher's code and could use it, I cannot use it. I have a row and a row, and the last result is the location where the table and form are written. The following is what I can use to change it.
[Html]
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> Registration Form Verification </title>
<Link rel = "stylesheet" type = "text/css" media = "screen" href = "css/screen.css"/>
 
<Script src = "js/jquery. js" type = "text/javascript"> </script>
<Script src = "js/jquery. validate. js" type = "text/javascript"> </script>
 
<Script>
$. Validator. setDefaults ({
SubmitHandler: function () {alert ("submitted! ");}
});
 
 
$ (). Ready (function (){
$ ("# Form1"). validate ({
Rules :{
Realname :{
Required: true
},
Username :{
Required: true,
Rangelength: [5, 8]
},
Password :{
Required: true,
Rangelength: [6, 12]

},
Pass1 :{
Required: true,
Rangelength: [6, 12],
Failed to: "# pass"

},
Sex :{
Required: true,
},
Xueli :{
Required: true
},
Burth :{
Required: true,
DateISO: true
},
Email :{
Required: true,
Email: true

}
}
})
});
</Script>
</Head>
<Body>
<Form id = "form1">
<Table border = "0" align = "center">
<Tr>
<Td> real (name cannot be blank, no other requirements) </td>
<Td> <input type = "text" id = "real" name = "realname" class = "required"> </td>
</Tr>
<Tr>
<Td> Login Name (the login name cannot be blank and the length should be 5 ~ Can contain Chinese characters (one Chinese character is counted as one character) </td>
<Td> <input type = "text" id = "user" name = "username" class = "required"> </td>
</Tr>
<Tr>
<Td> password (the length of the password cannot be 6 ~ 12 characters or numbers cannot contain Chinese characters) </td>
<Td> <input type = "password" id = "pass" name = "password" class = "required"> </td>
</Tr>
<Tr>
<Td> duplicate password (cannot be empty with a length of 6 ~ 12 characters or numbers cannot contain Chinese characters) </td>
<Td> <input type = "password" id = "pass1" name = "pass1"> </td>
</Tr>
<Tr>
<Td> gender </td>
<Td> <input type = "radio" id = "sex" name = "sex"> male <input type = "radio" id = "sex" name = "sex"> female </td>
</Tr>
<Tr>
<Td> Age (26 ~ 50) </td>
<Td> <input type = "text" id = "age" name = "age"> </td>
</Tr>
<Tr>
<Td> your degree </td>
<Td> <select id = "xueli" name = "xueli">
<Option> -- select your degree -- </option>
<Option> Junior College </option>
<Option> Technical Secondary School </option>
<Option> high school </option>
</Select>
</Td>
</Tr>
<Tr>
<Td> Date Of Birth (19820921) </td> <input type = "text" id = "birth" name = "birth"> </td> </tr>
<Tr> <td> hobbies </td> <input type = "checkbox" name = "box"> Table Tennis <input type = "checkbox" name = "box1 "> badminton <input type =" checkbox "name =" box2 "> online <input type =" checkbox "name =" box3 "> shopping </td> </tr>
<Tr> <td> email </td> <input type = "text" name = "email" id = "email"> </td> </tr>
<Tr> <td> id card </td> <input type = "text" id = "card" name = "card"> </td> </tr>
<Tr align = "center"> <td colspan = "2"> <input type = "submit" value = "submit"> </td> </tr>
</Table> </form>
</Body>
</Html>

From xweina's column

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.