I am attempting to figure out how to validate a number in the jQuery validate plugin as legitimate US currency, max two decimal place zeroes, without commas or dollar signs (250
I am attempting to figure out how to validate a number in the jQuery validate plugin as legitimate US currency, max two decimal place zeroes, without commas or dollar signs (25000.00, 1.00 , etc)
Simply include the additional-methods.js file and use the built-in currency
method as follows...
currency: ["$", false] // dollar sign optional
currency: "$" // dollar sign required (default)
Note: commas are optional in all cases.
DEMO: http://jsfiddle.net/d4ywy0fu/2/
NOTE: Your jsFiddle also contains a DOM ready handler inside of another DOM ready handler. While it's not harmful, it's totally superfluous.
$(function() { // <- DOM Ready Handler
$(document).ready(function() { // <- DOM Ready Handler
....