I'm working on localized mvc3 web application using unobtrusive validation. In web.config I've got :
<globalization culture="pl-PL" uiCulture="pl" />
Jquery 1.4.4 and jquery validation 1.6 is in use.
Problem is with decimal number separator character.
I can see that jquery validation is ignoring the culture and is expecting a dot character to always be the decimal separator. I need to use comma instead. I think it's the same in German language for example.
I created my own methods_pl.js file :
jQuery.extend(jQuery.validator.methods, {
number: function(value, element) {
return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value);
}
});
Above is solving the basic problem where decimal number is not recognized at all.
But when I try to use RangeAttribute on my model Decimal Price property it still doesn't work. How to solve this?