Created
April 30, 2013 20:46
-
-
Save oshikryu/5491811 to your computer and use it in GitHub Desktop.
validate price from input
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var validatePrice = /((\d+\.|\.)[0-9]{1,2})|\d+/; | |
if (!validatePrice.test($('#marketPrice').val())) { | |
alert_error('your price must be a numeric value'); | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment