I´m using JQuery Unobtrusive validation... I´m configured with Globalize to accept numbers like that : 1.500,50 (Masked by JQuery)
My code so far
1- ) Configured Globalize
$.validator.methods.number = function (value, element) {
return this.optional(element) || !isNaN(Globalize.parseFloat(value));
};
$(function () {
Globalize.culture('pt-BR');
});
2-) Configured web.config
<globalization culture="pt-BR" uiCulture="pt-BR" />
Ok, so I´m using a JQuery plugin to format Textbox to Money(PT-BR) like that : 1.500.000,50...
My JQuery Client Validation is working fine! But when it goes to server validation I got a ModelState error:
"The value '1.500.000,50' is not valid for Total."
How can I fix that?
Thanks
There is a problem in MVC binding to values like that. Go through this post by Phil Haack. It shows you how to create a cusom model binder to handle this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With