I made a mistake. Don't you know? <SCRIPT type = "text/JavaScript">
$ (Document). Ready (function (){
$ ("# Aspnetform"). Validate ({
Rules :{
<% = Txtconfirmpassword. clientid %> :{
Failed to: "# <% = txtpassword. clientid %>"
}
},
Messages :{
<% = Txtconfirmpassword. clientid %> :{
Failed to: 'passwords donot match .'
}
}
});
});
</SCRIPT>
View the HTML code:
<Input name = "ctl00 $ content $ txtpassword" type = "password" id = "ctl00_content_txtpassword"/>
<Input name = "ctl00 $ content $ txtconfirmpassword" type = "password" id = "ctl00_content_txtconfirmpassword"/>
Clientid corresponds to ID and uniqueid corresponds to name. jquery validate uses name verification.
Correct:
<SCRIPT type = "text/JavaScript">
$ (Document). Ready (function (){
$ ("# Aspnetform"). Validate ({
Rules :{
<% = Txtconfirmpassword. uniqueid %> :{
Failed to: "# <% = txtpassword. clientid %>"
}
},
Messages :{
<% = Txtconfirmpassword. uniqueid %> :{
Failed to: 'passwords donot match .'
}
}
});
});
</SCRIPT>
For debugging, you can add Debug: true first.