PDA

View Full Version : make terms page submit button count down


Mythotical
01-09-2005, 04:06 AM
I am wanting to know if there is a way to make the submit button at the bottom of the terms that must be read when registering to countdown from a number that I choose.

Example at this site: http://www.woltlab.de/en/forum/register.php

Their accept button counts down from 9 and you can't click the button until it reaches 0.

Anyone know.

Any help much appreciated.

Thanks
Myth

rake
01-09-2005, 08:33 AM
taken right from the source of that page:

<script type="text/javascript">
<!--
var secs = 10;
var wait = secs * 1000;
document.sform.submitbtn.disabled=true;

for(i=1;i<=secs;i++) {
window.setTimeout("update(" + i + ")", i * 1000);
}

window.setTimeout("timer()", wait);

function update(num) {
if(num == (wait/1000)) {
document.sform.submitbtn.value = "Accept";
}
else {
printnr = (wait/1000)-num;
document.sform.submitbtn.value = "Accept (" + printnr + ")";
}
}

function timer() {
document.sform.submitbtn.disabled=false;
}
//-->
</script>

of course, the form would be named sform ( <form name="sform" .. > ) and the button submitbtn ( <input type="submit" name="submitbtn" .. > )

Mythotical
01-10-2005, 12:18 AM
At the end, what do you mean by that stuff? Where does it all go?

Thanks for giving me that, I didn't realize it was staring me in the face.

Mink_
01-10-2005, 12:25 AM
If I'm not mistaken, it should go in the registration section your html templates.

Mythotical
01-10-2005, 01:01 AM
I got it, I put it in the registration_rules template and it works perfect. Thanks for the help Mink and Rake.

shadiguy1
01-10-2005, 01:06 AM
can someone please post exactly where and what to put thanks.