Currency validation
Please help with me writing a JavaScript Validation for currency/money field. So please provide any regular expressions if u have :) Also, for my region, don't need any currency symbols like '$' in the field. Only decimals are to be included for validation as special chars ., along with numbers. You could use a regexp: var regex = /^\d+(?:\.\d{0,2})$/; var numStr = "123.20"; if (regex.test(numStr)) alert("Number is valid"); If you're not looking to be as strict with the decimal places you might find it easier to use the unary ( + ) operator to cast to a number to check it's validity: var