这是我从别处抄得的,可供使用,将如果进行包装可以写成一个更通用的函数供数据校验。
function isNumeric(strNumber) {
if (strNumber.search(/^(-|\+)?\d*(\.\d*)?$/) != -1) return true;
else {alert('error');return false;}
}
function isNumeric(strNumber) {
if (strNumber.search(/^(-|\+)?\d*(\.\d*)?$/) != -1) return true;
else {alert('error');return false;}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货