The code is as follows:
Copy Code code as follows:
<script type= "Text/javascript" >
$ (function () {
$ ("#signupForm"). Validate (
The new section in the previous example
{
Rules: {
TxtPassword1: "Required",//password 1 required
TxtPassword2: {//Password 2 description More than 1 items using object type
Required:true,//required, here can be an anonymous method
Equalto: "#txtPassword1",//must be equal to password 1
Rangelength: [5, 10]//Length 5-10
},
Txtemail: "Email"//e-mail must be legal
}
});
});
</script>
<form id= "Signupform" method= "Get" action= "" >
<fieldset>
<legend> User Registration </legend>
<p>
<label for= "TxtPassword1" >
Password 1</label>
<input id= "TxtPassword1" name= "txtPassword1" type= "password"/>
</p>
<p>
<label for= "TxtPassword2" >
Password 2</label>
<input id= "TxtPassword2" name= "txtPassword2" type= "password"/>
</p>
<p>
<label for= "Txtemail" >
Email </label>
<input id= "Txtemail" name= "Txtemail"/>
</p>
<p>
<input type= "Submit" value= "submitted"/>
</p>
</fieldset>
</form>
Long Journey results:
Note: Using this JS authentication method in asp.net is best to replace the server control ID with the client ID, such as: <%= control Id.clientid%>,<%= Control id.uniqueid>
SOURCE download