1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
<head>
<script type="text/javascript">
var temps = 5;
var tps = temps
var x;
function Init()
{
window.document.getElementById('compteur').value=tps;
x = window.setInterval('Decompte()', 1000);
}
function Decompte()
{
tps = tps - 1;
window.document.getElementById('compteur').value = tps;
if(tps == -1)
{
window.document.getElementById('form').submit();
}
}
window.onload = Init;
</script>
</head>
<form action=test.php name="form" id="form" method=post>
<input type="text" name="compteur" id="compteur" size="2" readonly="readonly">
<input type="text" name="rep" id="rep" size="5">
<INPUT TYPE=submit NAME=Envoyer VALUE="Envoyer">
</form> |
Partager