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