I have a code for countdown timer and it works perfectly fine..
<html>
<title>project prelim</title>
<head>
<script type="text/javascript">
var ss = 10;
function countdown() {
ss = ss-1;
if (ss<0) {
window.location="testover.html";
}
else {
document.getElementById("countdown").innerHTML=ss;
window.setTimeout("countdown()", 1000);
}
}
</script>
</head>
<body onload="countdown()">
<center>
<table width="100%" height="600px" style="text-align:center;">
<tr><td valign="center"><h3>Redirecting to testover <h2 id="countdown"></h2></h3></td></tr>
</table>
</center>
</body>
</html>
Now if I am implementing it in a form which has a button like
<form action="batman.php" method="post">
<button id="submit" type="submit" >Submit</button>
</form>
The code which I have does not do the form submit action. How can I make the form submit action happen automatically as soon as the timer runs out .