关键词:js判断钱格式,js判断货币格式,js判断,钱的格式,js判断价格格式,js价格格式,价格格式判断



var str=document.form1.Price.value;

re=/^([1-9]\d*|0|)\.\d{2}$/

if(!re.test(str))

{alert("价格格式不正确!请填写比如:1.22");

document.form1.Price.value="";

document.form1.Price.focus();

return false;}