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>

Recommended Answers

For god's sake, where is the problem? (Did you notice that this here is a PHP forum, not for JavaScript? And did you notice that you are not only allowed, but supposed to use code tags?)

Jump to Post

All 2 Replies

For god's sake, where is the problem? (Did you notice that this here is a PHP forum, not for JavaScript? And did you notice that you are not only allowed, but supposed to use code tags?)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.