I have a jquery function that validates a value in US currency format.
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?
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.