-Dman100-
asked on
validating currency input beyond hunderdth
I have a jquery function that validates a value in US currency format.
This works for currency values from 0.01 up to 999.00, but it fails when a value of a thousand or more. I'm not very good with regular expressions at all.
How can I modify the regex to correctly validate the value to support currency values up to 999,999.00?
Thanks for any help.
j$.validator.addMethod("money", function(value, element) {
return this.optional(element) || /^(\d{1,3})(\.\d{2})$/.test(value);
}, "Must be in US currency format 0.99");
This works for currency values from 0.01 up to 999.00, but it fails when a value of a thousand or more. I'm not very good with regular expressions at all.
How can I modify the regex to correctly validate the value to support currency values up to 999,999.00?
Thanks for any help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER