代码
var checkNumControls = new Array("TbZipCode","TbPhone1","TbPhone2","TbPhone3","TbSeeDoctorAgeYear","TbSeeDoctorAgeMonth",
"TbFatherBearAge","TbMatherBearAge","TbAnnualIncome","TbGravidityNum","TbAbortionNum","TbAge","TbBornWeight","TbWeight","TbHeight",
"TbVisitWeight","TbVisitHeight","TbVisitBodySurfaceArea","TbVisitAge","TbDefectSize","TbShuntingConditionNo1","TbShuntingConditionNo2","TbEF","TbOcclusionAge",
"TbOperationAge","TbCost","TbCost1");
for(var j=0;j<checkNumControls.length;j++)
$(
"#"+checkNumControls[j]).keyup(function(){$(this).val($(this).val().replace(/[^\d\.-]+/,""));});

jquery 验证文本框数字事件|有效|快捷 给控件绑定清楚非数字事件

posted on 2010-08-12 10:53  bestsaler  阅读(339)  评论(0编辑  收藏  举报