Reputation: 6280
I have set compare attribute for comparing passwords as explained in this blog. But it's not working. When I googled about it I found that it's a known bug in jquery.validate.js file.
Is the Compare Validator Bugged
I tried the solutions given in above links but no success.
Upvotes: 1
Views: 784
Reputation: 60516
You are mixing server and client side. The DataAnnotation Attribute CompareAttribute
works only on server side.
But you can get similar functionality using the jQuery validation plugin.
$.validator.addMethod("yourMethodName", function(value, element) {
// compare and return
}
Check out theese two tutorials.
Upvotes: 1