简单的防止表单重复提交

function myInterval(){
    if(countDownTime==0){
        $("#YanZhengMa").attr("disabled",false);
        $("#YanZhengMa").css("cursor","pointer");            
         $("#YanZhengMa").val("获取手机验证码");
        clearInterval(timer);
        countDownTime = defaultCountDownTime;
        return;
    }
    $("#getYanZhengMa").val("重新获取("+countDownTime+"s)");
    countDownTime--;
}
function countDown(){
    countDownTime = defaultCountDownTime;
    $("#YanZhengMa").attr("disabled","disabled");
    $("#YanZhengMa").css("cursor","auto");
    timer = setInterval("myInterval()",1000);
}

 

posted @ 2015-04-27 09:32  黑面骑士  阅读(174)  评论(0编辑  收藏  举报