2

With VS2010's default MVC3 project template, jQuery version is 1.5.1 and it works fine to support Unobtrusive Validation.

Today I downloaded jQuery 1.7.1 to replace 1.5.1 and Unobtrusive Validation stopped working. The JS files I have in my project are:

  • jquery-1.5.1.min.js/jquery-1.7.1.min.js
  • jquery.validate.min.js
  • jquery.validate.unobtrusive.min.js

I deleted all other JS files.

The only difference in my code is to choose different version of jQuery.

Anybody else experienced same issue?

hardywang
  • 4,864
  • 11
  • 65
  • 101

2 Answers2

5

According to the author's site, it's only verified to be working with up to jQuery 1.6.1. Though I use 1.6.4 currently with no noticeable problems, it would not surprise me if 1.7.* has breaking changes that need to be accounted for before the unobtrusive validation works with it. I haven't upgraded to 1.7.1 yet (or rather I did, and have since rolled back), because when I tried 1.7 I ran into other compatibility issues with Telerik's MVC controls.

Edit: I just noticed the link I tracked down was for the validation plugin not the unobtrusive validation plugin. Unless the most recent versions still has an issue with it, I can only suggest that you wait until they make the necessary adjustments before upgrading to 1.7.*

Edit: Also, I made a comment below but you may want to try the Nuget package and see if this helps resolve your problem, I have no issues with this now. http://nuget.org/packages/Microsoft.jQuery.Unobtrusive.Validation

Nick Albrecht
  • 16,607
  • 10
  • 66
  • 101
  • Out of curiosity, which Telerik MVC controls do you use? – CtrlDot Nov 24 '11 at 17:32
  • My problems mainly had to do with their grid and tree view controls. Specifically the client side click event had the issue. It was a confirmed bug in 1.7 and I haven't tried 1.7.1 yet to see if it has fixed the issue. – Nick Albrecht Nov 24 '11 at 17:39
  • I have same problem and my custom validation functions does not work with jQuery 1.7.1, so I have reverted my version with old 1.5.1 and all my custom validation stated working. – Zeeshan Umar Jun 04 '12 at 09:35
  • Maybe give the Nuget packages a shot and see if they help resolve your problem, I have no issues with this now. http://www.nuget.org/packages/Microsoft.jQuery.Unobtrusive.Validation – Nick Albrecht Jun 04 '12 at 23:09
0

This has to do with the MicrosoftMvcValidation.js. I am using jquery-1.6.2 and it seems to work fine.

You have to wait for that library to be updated before you can update the jquery version.

Take a look at this answer.

jquery_validation

Community
  • 1
  • 1
CtrlDot
  • 2,463
  • 14
  • 11