网站延时注册代码(JS)
下面的代码是用JS实现网站延时注册的功能,倒计时时不能注册,延时结束时方可进行注册
<FORM name=register method=post action=reg.asp?action=yes>
<input type="hidden" name="action" value="agree">
<INPUT class="auuo" type=submit value=" 同意注册 " name=Submit>
</FORM>
<SCRIPT>
secs = 60; // 延时时间,这里设了60毫秒
wait = secs * 100;
document.forms.register.Submit.disabled =true;
for(i=1;i<=(wait/100);i++) {
window.setTimeout("doUpdate(" + i + ")", i * 100);
}
window.setTimeout("Timer()", wait);
function doUpdate(num) {
if(num == (wait/100)) {
document.forms.register.Submit.value = " 同意注册 ";
} else {
wut = (wait/100)-num;
document.forms.register.Submit.value = " 同意前请先阅读 (" + wut + ")";
}
}
function Timer() {
document.forms.register.Submit.disabled =false;
}
</SCRIPT>
上面这段代码另存为html即可运行,此延时代码,在论坛注册与会员注非常常见。