I am trying to use the jquery globalization plugin (https://github.com/jquery/globalize) to work with asp.net mvc3 client side unobtrusive validation. I have tied in both the en-CA and fr-CA cultures and was seeing some discrepancies between what the plugin accepting as a valid number vs what the service side validation was accepting. Here is some examples of calling the Globalize.parseFloat method with different inputs with the two cultures and what I am getting out (bold indicates that server side validation doesnt validate the number) fr-CA
en-CA
Stepping through the parseFloat code looks like this is the intended output but I cant see how this is intended so I am hoping I am missing something ... or is this intended?
Thanks
Looks like this is a known issue in the globalization plugin (see https://github.com/jquery/globalize/issues/46). Looks like I will have to run my own regex to make sure it is in the right format for client side validation (good thing I only have to deal with two languages at the moment :)
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