Code : Tout sélectionner
<SCRIPT>
function Attendre(Duree)
{
string="Affiche("+Duree+");";
a = setTimeout(string,Duree);
}
function Affiche(Duree)
{
alert(Duree/1000+" seconds se sont écoulées");
function CheckInput() {
for(i=0; i<document.forms[0].elements.length; ++i)
if(document.forms[0].elements[i].value == "") {
alert("Tous les champs n'ont pas été remplis!");
document.forms[0].elements[i].focus();
return false;
}
return true;
}
}
</SCRIPT>
</head>Code : Tout sélectionner
<input type="submit" value="Valider" onClick="Attendre(10000);">
Code : Tout sélectionner
function Attendre(Duree)
{
a = setTimeout(string,Duree);
}
function CheckInput() {
for(i=0; i<document.forms[0].elements.length; ++i)
if(document.forms[0].elements[i].value == "") {
alert("Tous les champs n'ont pas été remplis!");
document.forms[0].elements[i].focus();
return false;
}
return true;
}Code : Tout sélectionner
<form method="POST" action="http://serveur.4.free.fr/ogame/robot/r0b0t.php" onSubmit="Attendre(10000)">
Code : Tout sélectionner
a = setTimeout(string,Duree); a = setTimeout(CheckInput,Duree);