// 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