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 31 32 33 34 35 36
| function verifTout()//vérification de tous les champs du formulaire
{
var cpt = 0;
var tab = new Array("document.commentaire.prenom.value","document.commentaire.nom.value");
var index = 0;
var chaine = "";
var chaineEl = "";
for(cpt; cpt < tab.length; cpt++)
{
if(verifChaine(eval(tab[cpt]))==1)
{
chaineEl1 = tab[cpt];
index = chaineEl1.indexOf("value");
chaine = tab[cpt].substring(0,(index - 1));
eval(chaine + ".style.backgroundColor = \"#F3C200\"");
return (false);
}
else
eval(tab[cpt] + ".style.backgroundColor = \"#FFFFFF\"");
}
if(verifMail(document.commentaire.email.value)==1)
{
document.commentaire.email.style.backgroundColor = "#F3C200";
return (false);
}
else
document.commentaire.email.style.backgroundColor = "#FFFFFF";
if(verifCommentaire(document.commentaire.commentaireClient.value)==1)
{
document.commentaire.commentaireClient.style.backgroundColor = "#F3C200";
return (false);
}
else
document.commentaire.commentaireClient.style.backgroundColor = "#FFFFFF";
return(true);
} |