Front-end Form verification:
1<! DOCTYPE html>234<meta charset= "UTF-8" >5<title> form verification (implemented using the validation plugin) </title>6<script src= ". /jslib/jquery-1.11.0.js "></script>7<script src= ". /jslib/jquery.validate.js "></script>8<script src= ". /jslib/messages_zh.js "></script>9 Ten<script> One $ (function () { A$ ("#formid"). Validate ({ - rules:{ - username:{ theRequiredtrue - }, - password:{ -Requiredtrue, +rangelength:[6,10] - }, + repassword:{ ARequiredtrue, atEqualto: "[name= ' Password ']" - }, - height:{ -Requiredtrue, -min:[180] - }, in age:{ -Requiredtrue, torange:[18,56] + } - }, the messages:{ * username:{ $Required: "Cannot be empty"Panax Notoginseng }, - password:{ theRangelenght: "Password length must be between 6-10 characters" + }, A height:{ theMin: "Height must be above 180" + }, - age:{ $Range: "Age must be between 18 and 56 years old" $ } - } - }); the }); -</script>Wuyi the<body> -<form id= "Formid" action= "#" > Wu -<!--cannot be empty-- AboutUser name: <input type= "text" name= "username"/> <br/> $ -<!--length between 6-10 characters-- -Password: <input type= "text" name= "password"/> <br/> - ARepeat Password: <input type= "text" name= "Repassword"/> <br/> + the<!--greater than 180cm--> -Height: <input type= "text" name= "height"/> <br/> $ the<!--between the ages of 18 and 56- theAge: <input type= "text" name= "ages"/> <br/> the theE-mail: <input type= "text" name= "email"/> <br/> - in<input type= "Submit" value= "Submission"/> the</form> the</body> AboutUsing jquery's validation plugin to implement form validation