网站制作学习网JS脚本→正文:js判断钱格式
字体:

js判断钱格式

JS脚本 2008/11/14 16:14:22  点击:不统计

关键词: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;}

·上一篇:限制textarea字数 >>    ·下一篇:js判断年月日格式是否正确 >>
推荐文章
最新文章