0

i want to create a timer for my php page i created the page that only 20 second i want that the time should be as 00:00:20 (hh:mm:ss) plz help my scipt are..........................................................................................................


<tr>
<!-- countdown script -->
<td style="text-align:left;font-size:10pt;font-family:Verdana, Arial;">Time Left: <input type="text" name="seconds" size="3">
<script language="javascript" type="text/javascript">
var myTime = 20;
function countDown() {
document.form.seconds.value = myTime;
if (myTime == 0) {
location.href="trivia1.php";
}
else if (myTime > 0) {
myTime--;
setTimeout("countDown()",1000);
}
}

countDown();
</script>
</td>
</tr>

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by peter_budo
0
<script language="javascript" type="text/javascript">
var myTime = "20";
function countDown() {
	document.form.seconds.value = myTime;
	if (myTime == 0)
	{
		location.href="trivia1.php";
	}
	else if (myTime > 0)
	{
		myTime--;
		setTimeout("countDown()",1000);
	}
}
</script>

<body onload="countDown();">
<form name="form">
Time Left: <input type="text" name="seconds" size="3">
</form>
</body>

Edited by makman99: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.