Click here to Skip to main content
13,138,791 members (54,786 online)
Click here to Skip to main content
Add your own
alternative version


3 bookmarked
Posted 10 Sep 2012

Compare Validator Problem and Solution in MVC3 with jQuery 1.8.1

, 17 Jul 2013
Rate this:
Please Sign up or sign in to vote.
Compare Validator is not working with latest jQuery lib while using with ViewModel in MVC


In MVC3 for client side validation, we are using jQuery. It seems to be working for all the validations but I tried Compare Validator to compare ViewModel property with Model property and it was not working. In any case, it is saying it is not matched. I am using all the latest jQuery libraries. I did some Googling and found that it is a bug in jQuery and also found a solution which is given below.

Under the project, there is a jquery.validate.unobtrusive.min.js file. Search the following code in that.


Replace this line with the following line:


After changing this, it works fine.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Mehul M Thakkar
Technical Lead
India India
Mehul Thakkar is having 8 yrs of experience in IT industry. He is having good command over Ms .Net and Ms Sql Server

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.170915.1 | Last Updated 18 Jul 2013
Article Copyright 2012 by Mehul M Thakkar
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid