I am working on a localized mvc3 web application using unobtrusive validation. In web.config, I have:
<globalization culture="pl-PL" uiCulture="pl" />
Uses jQuery 1.4.4 and jquery 1.6 validation.
The problem is the decimal separator character.
I see that the jquery validation ignores the culture and expects the dot character to always be a decimal separator. Instead, I need to use a comma. I think this is the same in German.
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); } });
The main problem is solved above when the decimal number is not recognized at all.
But when I try to use RangeAttribute on my Decimal Price model, it still doesn't work. How to solve this?
mb666 source share