日期:2014-05-16  浏览次数:20303 次

js表单验证
正整数验证
var reg = /^(0|([1-9]\d*))$/;
                var txtvalue = document.getElementById("txtqty").value;
                if (!reg.exec(txtvalue)) {
                    alert("请输入正整数");
                    $('#txtqty').focus();
                    return false;
                } else {
                    return true;
                }