$(function () {
    //首次加载
    $("#valiCode").attr("src", "/QNAdminLogin/GetValidateCode?time=" + (new Date()).getTime());
    $.get("/QNAdminLogin/GetCurrentValidateCode", function (data) {
        $("#ValidateCode").val(data);
    });

    //单击验证码事件
    $("#valiCode").bind("click", function () {
        this.src = "/QNAdminLogin/GetValidateCode?time=" + (new Date()).getTime();
        $.get("/QNAdminLogin/GetCurrentValidateCode", function (data) {
            $("#ValidateCode").val(data);
        });
    });
});

function changeCode() {
    $("#valiCode").click();
}

//只能输入整数
function InputDigitalOnly(target) {
    var targetValue = $(target).val();
    $(target).val(targetValue.replace(/[^\d]/g, ''));
    if (targetValue == "00") {
        $(target).val("0");
    }
}
function HundredLimit(target) {
    var targetValue = $(target).val();
    if (parseInt(targetValue) > 100) {
        $(target).val("100");
    }
}