正则表达式(判断整数和两位小数)
<script language="JavaScript" type="text/javascript"> function clearNoNum(obj) { obj.value = obj.value.replace(/[^\d.]/g, ""); obj.value = obj.value.replace(/^\./g, ""); obj.value = obj.value.replace(/\.{2,}/g, "."); obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", "."); }</script> <A:TextBoxControl ID="txtDurationTime" runat="server" Width="95" onKeyUp="clearNoNum(this)" onBlur="value=value.replace(/[^\d\.]/g,'')" />