Bonjour, j'écrit un formulaire pour questionner une base de données mysql. Mon valideur de formulaire fonctionnait jusqu'à ce que j'inclus mon action=page.php. Or la fonction de validation fonctionne de temps en temps. Savez vous pourquoi?
<HTML>
<HEAD>
<script type="text/javascript">
function valider()
{
x=document;
soumissionOK="True";
if ( (x.Nom.length ==0) || (x.Prenom.length ==0) || (x.Ville.length ==0))
{
alert("Un des champs n'est pas ou est mal renseigné");
soumissionOK="False";
}
if (soumissionOK=="False")
{
return false;
}
else
{
return true;
}
}
</script>
<link rel="stylesheet" href="style/style.css" type="text/css">
</HEAD>
<BODY class="menua" >
<P align="center" STYLE="font-weight:bold; font-size: 16px ;font-weight:bold;font-family: Century Gothic;">Rechercher un tiers</P>
<P STYLE="position:absolute; left:5;top:45">nom:</P>
<P STYLE="position:absolute; left:5;top:70">prénom:</P>
<P STYLE="position:absolute; left:5;top:95">Ville:</P>
<form name="R_tiers" action="R_tiers.php" method="post" OnSubmit="return(valider(this))">
<P STYLE="position:absolute; top:45;left:300">
<input type="text" style="Width:80px; background-color:'#C0C0C0';"name="Nom"value=""></P>
<P STYLE="position:absolute; top:70;left:300">
<input type="text" style="Width:80px; background-color:'#C0C0C0';"name="Prenom"value=""></P>
<P STYLE="position:absolute; top:95;left:300">
<input type="text" style="Width:80px; background-color:'#C0C0C0';"name="Ville"value=""></P>
<input type="submit" class="button1"style="position:absolute;align:center; top:265;left:200; background-color:'#C0C0C0';" value="lancer la recherche">
</form>
</BODY>
</HTML>