Skip to content

Instantly share code, notes, and snippets.

@oshikryu
Created April 30, 2013 20:46
Show Gist options
  • Save oshikryu/5491811 to your computer and use it in GitHub Desktop.
Save oshikryu/5491811 to your computer and use it in GitHub Desktop.
validate price from input
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