註冊時先閱讀條款,10秒後按鈕可用
拷貝以下程式碼即可,僅僅是模擬這種效果:
index.html程式碼如下:
<FORM name="agree" action="reg.aspx?action=apply" method="post">
<INPUT type="submit" value= "請認真檢視<服務條款和宣告>(10秒後繼續) " name="agreeb">
</Form>
<SCRIPT language=javascript>
var secs = 10;
document.agree.agreeb.disabled=true;
for(i=1;i <=secs;i++) {
window.setTimeout( "update( " + i + ") ", i * 1000);
}
function update(num) {
if(num == secs) {
document.agree.agreeb.value = "同意並註冊 ";
document.agree.agreeb.disabled=false;
}
else {
printnr = secs-num;
document.agree.agreeb.value = "請認真檢視<服務條款和宣告>( " + printnr + " 秒後繼續) ";
}
}
</SCRIPT>