js控制再次点击按钮之间的间隔时间可防止重复提交
<scripttype="text/javascript"language="javascript">
varwait=60;
functionchange(){
$o=$("#J_refresh_checkcode");
if(wait==0){
$o.removeAttr("disabled");
$o.html("看不清?换一张");
wait=60;
}else{
$o.attr("disabled",true);
$o.attr("font-color","gray");
$o.html(wait+"秒后可重新获取");
wait--;
if(wait==59){
varimgNode=document.getElementById("vimg");
imgNode.src="../../AjaxServer/CheckCodePic.ashx?t="+(newDate()).valueOf();//这里加个时间的参数是为了防止浏览器缓存的问题
$("#J_checkcode_tip").addClass("hide");
$("#J_checkcode_tip>div").html("");
$("#<%=hidPicMessage.ClientID%>").val("");
}
setTimeout(function(){
change()
},
1000)
}
}</script>
则html如下:
<divclass="kv_itemclear"> <spanclass="kv_labelfl">验证码</span> <inputname="checkCode"class="i_textshortfl"id="J_checkcode_input"onmousedown="ClearCodeMessage()"type="text"maxlength="6"autocomplete="off"onblur="CheckCode()"/> <imgsrc="../../AjaxServer/CheckCodePic.ashx"height="28"id="vimg"alt=""style="float:left;margin:-1px003px"/> <aid="J_refresh_checkcode"onclick="change()">看不清,换一张</a> <divclass="msgmsg-inlinemsg-weakhide"id="J_checkcode_tip"> <divclass="msg-defaultmsg-error"> <iclass="msg-icon"></i> <divclass="msg-content"> </div> </div> </div> </div>
热门推荐
1 带狗狗训练
4 听力训练狗狗
6 怎训练狗狗
7 腹肌训练狗狗
8 网球训练狗狗
9 记叙文训练狗狗
10 狗狗太凶怎么训练
11 核心力量训练狗狗
12 狗狗乱叫怎么训练
13 发音训练狗狗
14 怎么训练狗狗叼东西给主人
15 荆州训练狗狗
16 篮球训练狗狗
17 做训练狗狗
18 训练狗狗坐姿