60 seconds countdown to a little JavaScript

Source: Internet
Author: User
Tags table name window
Javascript

<table name=agree border= "0" cellpadding= "ten" cellspacing= "0" align=center width= "80%" >
<tr align=center>
<TD width= "50%" align= "right" >
<form Name=register method=post action=reg_shang.asp?action=yes>
<input type= "hidden" name= "action" value= "agree" ><input class= "Go-wenbenkuang" type=submit value= "consent to register" name =submit>
</FORM>
</td>
<TD width= "50%" align= "left" >
<form action=index.asp method=post><input Class=go-wenbenkuang type=submit value= "I Disagree" ></FORM> </td>
</tr>
</table>

<SCRIPT>
secs = 60; Number of secs to Delay-china-studio
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 = "Consent to register";
} else {
Wut = (wait/100)-num;
Document.forms.register.Submit.value = "Please read first (" + Wut + ") before agreeing;
}
}

function Timer () {
Document.forms.register.Submit.disabled =false;
}
</SCRIPT>



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.