mais où est le PB ??

mais où est le PB ?? - Programmation

Marsh Posté le 14-06-2001 à 21:34:24    

Ce formlaire ne fais pas les verifications lorsqu'il y a le champ nom qui est vide.
Quelqu'un peut-il m'aider à touver l'erreur svp !! ?? :eek2:  
<html>
<head>
<meta http-equiv="Content-Type"content="text/html charset=iso-8859-1">
<title>Livre d'or</title>
<SCRIPT LANGUAGE="JavaScript">
function validation(){
         if (document.LIVREDOR.nom.value.length < 1)
         {window.alert("Veuillez entrez votre nom." );
         return false;
         }
 
return true;
}
</SCRIPT>
 
</head>
<body leftmargin="0" bgcolor="black" text="white" >
 
 
<FORM NAME="LIVREDOR"  onSubmit="returnvalidation();">
<p align="center">
  </p>
<table cellpadding=2 cellspacing=0 border=0 align="center">
  <tr>
    <td align=right><font face="verdana, arial, helvetica" size=2>Nom : </font></td>
    <td>
      <input name="nom" size=30 length=20 >
    </td>
  </tr>
  <tr>
    <td align=right><font face="verdana, arial, helvetica" size=2>Email : </font></td>
    <td>
      <input name="email" size=30 maxlength=30 >
    </td>
  </tr>
  <tr>
    <td align=right><font face="verdana, arial, helvetica" size=2>Ville : </font></td>
    <td>
      <input name="city" size=30 maxlength=60 >
    </td>
  </tr>
  <tr>
    <td align=right><font face="verdana, arial, helvetica" size=2>Pays : </font></td>
    <td>
      <input name="country" size=30 maxlength=60 >
    </td>
  </tr>
  <tr>
    <td align=right><font face="verdana, arial, helvetica" size=2>Commentaire :</font></td>
    <td>
      <input name="text" size=30 maxlength=255 >
    </td>
  </tr>
  <tr>
    <td align=right colspan=2>
      <input type="submit" value="Ajouter mon commentaire">
  <input type="reset" value=CLEAR>
    </td>
  </tr>
</table>
</FORM></body>
</html>

Reply

Marsh Posté le 14-06-2001 à 21:34:24   

Reply

Marsh Posté le 14-06-2001 à 21:41:34    

Je pense que ça vien de ton test essaie ceci:
<SCRIPT LANGUAGE="JavaScript">
function validation(){
         if (document.LIVREDOR.nom.value!="" )
         {window.alert("Veuillez entrez votre nom." );
         return false;
         }
 
return true;
}
</SCRIPT>


---------------
groumf!groumf!
Reply

Marsh Posté le 14-06-2001 à 21:49:24    

je viens d'essayer mais ça ne marche pas ... :eek2:

Reply

Marsh Posté le 14-06-2001 à 21:52:06    

Heu bon d'accord je me suis lamentablement planté, ce que j'ai envoyé marchera jamais...
biensur, il fallait lire ceci: ;)  
<SCRIPT LANGUAGE="JavaScript">  
function validation(){  
         if (document.LIVREDOR.nom.value=="" )  
         {window.alert("Veuillez entrez votre nom." );  
         return false;  
         }  
 
return true;  
}  
</SCRIPT>


---------------
groumf!groumf!
Reply

Marsh Posté le 14-06-2001 à 21:57:08    

j'ai essayé aussi mais j'ai pas réussi !
 
As-tu testé le script chez toi ?
 
merci.

Reply

Marsh Posté le 14-06-2001 à 22:07:12    

he bien en fait... non
Désolé, je pensais que c'étais juste cette erreur le pb...
donc j'ai tout testé...
voila la page:
<FORM NAME="LIVREDOR" onSubmit="validation();">
<p align="center">
</p>
<table cellpadding=2 cellspacing=0 border=0 align="center">
<tr>
<td align=right><font face="verdana, arial, helvetica" size=2>Nom : </font></td>
<td>
<input name="nom" size=30 length=20 >
</td>
</tr>
<tr>
<td align=right><font face="verdana, arial, helvetica" size=2>Email : </font></td>
<td>
<input name="email" size=30 maxlength=30 >
</td>
</tr>
<tr>
<td align=right><font face="verdana, arial, helvetica" size=2>Ville : </font></td>
<td>
<input name="city" size=30 maxlength=60 >
</td>
</tr>
<tr>
<td align=right><font face="verdana, arial, helvetica" size=2>Pays : </font></td>
<td>
<input name="country" size=30 maxlength=60 >
</td>
</tr>
<tr>
<td align=right><font face="verdana, arial, helvetica" size=2>Commentaire :</font></td>
<td>
<input name="text" size=30 maxlength=255 >
</td>
</tr>
<tr>
<td align=right colspan=2>
<input type="submit" value="Ajouter mon commentaire">
<input type="reset" value=CLEAR>
</td>
</tr>
</table>
</FORM></body>
</html>
 
bon la ca marche et encore désolé(dans ces forums, y'a toujours un type trop sur de lui qui fait le cake ;) )


---------------
groumf!groumf!
Reply

Marsh Posté le 14-06-2001 à 22:14:25    

MERCI !  MERCI!  
 :)  
 
(Tu n'as pas à être désolé !)

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed