You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think it's an issue, but I've faced some difficulties to post a form with a decimal field in it.
Because I'm french and my decimal separator is a comma, jQuery Validation stop the post because my decimal is not a valid number.
It's not true, it's a well formatted number according to my culture specifications.
I searched and all the solutions I have found are to install jquery globalize (with his dependencies, cdrl.js) in my project to solve this matter, and other solutions that I don't want to.
I think I've found a better way to solve it by replacing the RegExp in the jquery validation source for the number validation method from
^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$
to
^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:(\.|,)\d+)?$
which is almost the same.
It work fine for all this decimal number format :
149.99
149,99
1,149.99
So, would it not be simpler to replace the english culture oriented number validation RegExp by this global culture oriented one ??
The text was updated successfully, but these errors were encountered:
Include Globalize is not the good choice for an application that runs into one single language. It's an haevy client side library just to recognize comma instead of point on client side validation.. Just because the default regex present in the jquery validation library is not enough complete. There is not thousand ways to write a decimal number I think.
I don't think it's an issue, but I've faced some difficulties to post a form with a decimal field in it.
Because I'm french and my decimal separator is a comma, jQuery Validation stop the post because my decimal is not a valid number.
It's not true, it's a well formatted number according to my culture specifications.
I searched and all the solutions I have found are to install jquery globalize (with his dependencies, cdrl.js) in my project to solve this matter, and other solutions that I don't want to.
I think I've found a better way to solve it by replacing the RegExp in the jquery validation source for the number validation method from
to
which is almost the same.
It work fine for all this decimal number format :
So, would it not be simpler to replace the english culture oriented number validation RegExp by this global culture oriented one ??
The text was updated successfully, but these errors were encountered: