ASP.NET MVC 3 and the jquery.validate.unobtrusive.js won't respect culture format - by toebens2

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 645066 Comments
Status Closed Workarounds
Type Bug Repros 13
Opened 2/18/2011 2:13:40 AM
Access Restriction Public


there seems to be a bug with MVC 3 and the jquery.validate.unobtrusive.js:

I'm developing a german mvc 3 website and have included the jquery script:
in this order.

the web.config has add key="UnobtrusiveJavaScriptEnabled" value="true" (as well as globalization culture="de-DE" uiCulture="de-DE")

if i enter some german formated number like "1,2" into a textbox for a model property (of type double) i get a validation error: "The field THENAMEOFPROPERTY must be a number." ("1.2" is working)

if i disable UnobtrusiveJavaScriptEnabled by setting key="UnobtrusiveJavaScriptEnabled" value="false" in web.config there is no validation error and it is working correctly.

i also tried using the jquery globalization plugin but the jquery validation plugin doesn't seem to use it (please also have a look at too)

thanks, toebens
Sign in to post a comment.
Posted by Microsoft on 9/13/2011 at 1:49 PM
Hi everyone,

While ASP.NET MVC doesn't use the jQuery Validate globalization features out of the box, it's quite easy to add the functionality to the sites and apps that you're building.

One of our documentation writers, Rick Anderson, wrote a blog post on how to get this all working:
Some of the content is also on MSDN:
And our prolific blogger Scott Hanselman wrote an article recently as well:

We're also looking to make this work better out of the box, but for now these easy solutions should get you started.

The ASP.NET Team
Posted by Microsoft on 2/18/2011 at 2:58 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(