javascript正则表达式,验证输入的数保留两位小数,整数部分为1到2
谢谢!varregexHeight=newRegExp("/^[1-2]+\.\d{2}$/");if(height==""){HeightMessage.innerTe...
谢谢!
var regexHeight=new RegExp("/^[1-2]+\.\d{2}$/");
if(height=="")
{
HeightMessage.innerText="身高不能为空!";
lblHeight.innerText="*";
}
else if(!regexHeight.test(height))
{
HeightMessage.innerText="身高格式不正确!";
lblHeight.innerText="*";
}
验证不起呢??? 展开
var regexHeight=new RegExp("/^[1-2]+\.\d{2}$/");
if(height=="")
{
HeightMessage.innerText="身高不能为空!";
lblHeight.innerText="*";
}
else if(!regexHeight.test(height))
{
HeightMessage.innerText="身高格式不正确!";
lblHeight.innerText="*";
}
验证不起呢??? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询