/*** 输入实在验证* @param that*/var strLast = ""; //记录每次正常输入的var strIndex = 0; //记录每次正常输入的长度function realmonitor(that){var val = that.value;var flag = true;if(val.length > 0){if(isNaN(val)){ //通过这个控制能是数字可以包含“.”val = strLast;flag = false;}var regx = /^\d+(\.\d{ 1,2})?$/; // 数字正则[?匹配0次或1次],只能输入两位小数if (!regx.test(val)) {if(val.substr(val.length-1,val.length) != "."){flag = false;val = strLast;}}if(val.length > 9){ //只能有9位数flag = false;val = val.slice(0,9);}if(flag == false){ //只有当值在上面的阶段改变以后才需要重新赋值that.value = val;}strLast = val;strIndex = val.length;}else{var val = strLast;if(strIndex == 1 || strIndex == 0){ //表示是最后一位val = "";}that.value = val;}};