[b][red]This message was edited by bowens at 2002-8-7 14:57:14[/red][/b][hr]
I want to put a timer box on this window. After they answer
the questions and submit (I haven't coded that yet)the window automatically
goes to the main page. I want a timer box the users can see the clock running down from 5 minutes.
ANY IDEAS?
Thank you
The Game
The Game
Comments
Yep, this is simple and great idea, but I can only offer a solution for IE5+ or NS6+.
Here it is.
[code]
var secondsToGo = 300;
function updateTime() {
secondsToGo--;
var obj = document.getElementById("timeLeft");
obj.innerHTML = secondsToGo;
if (secondsToGo > 0) {
setTimeout("updateTime();", 1000);
} else {
// Time's Up code!
}
}
Time Left: 300
[/code]
If you want it formatted, then you'll have to play with the figures, but the countdown feature works. You also have the ability to document.location.href="timesUp.html"; when the clock has expired!
HTH
Bradley q:)