//验证是否数字 function numValidate(data) { //0和非0的数字 var reg = new RegExp("^(0|[1-9][0-9]*)$"); if (!reg.test(data)) { return false; } return true; }