Ever turned on the client side validation in ASP MVC?
Seen that numbers with comma’s aren’t valid?
Here is a small solution for that problem.
You can override the methods of the jQuery validation plugin.
Insert this code in a new javascript code file and make sure you reference it as last.
Only if it’s referenced after the jQuery validation plugin, it will override the code in the plugin.
$.validator.methods.range = function (value, element, param) { var globalizedValue = value.replace(",", "."); return this.optional(element) || (globalizedValue >= param[0] && globalizedValue <= param[1]); } $.validator.methods.number = function (value, element) { return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:[\s\.,]\d{3})+)(?:[\.,]\d+)?$/.test(value); }