标签:
1.只能输入正整数的js动态验证
<script>
$(function () {
$("#TextBox1").bind(‘input propertychange‘, function () {
var regEx = /^\d+(\.\d+)?$/;
var strVal = $(this).val();
if (regEx.test(strVal) == false) {
$(this).val($(this).val().substring(0, length - 1));
};
});
});
</script>
<asp:TextBox ID="TextBox1" Width="120px" runat="server"></asp:TextBox>
标签:
原文地址:http://www.cnblogs.com/zinT/p/4560277.html