Problème pour fonction mail sous firefox - Page 2

Résolu
Précédent
  • 1
  • 2
  1. drogba7213 Messages postés 1550 Statut Membre 22
     
    Voila ce que j'ai fait mais ca ne fonctionne pas

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html><script language="javascript">
    //fonction verification si champs remplis
    //si le champ est vide, elle fait un message d'alerte et renvoie false donc le formulaire n'est pas envoyé
    //si tous les champs testés par les if ne sont pas vides elle renvoie true et le formulaire est envoyé
    function verif_champs(){
    if(document.GetElementById('civilite').value == ""){
    alert("Vous devez remplir le champ Civilité !");
    return false
    }
    //etc tu fais pareil tu rajoutes des if ..... pour tous les champs text

    return true;
    }
    if(document.GetElementById('nom').value == ""){
    alert("Vous devez remplir le champ Nom !");
    return false
    }
    //etc tu fais pareil tu rajoutes des if ..... pour tous les champs text

    return true;
    }
    if(document.GetElementById('prenom').value == ""){
    alert("Vous devez remplir le champ Prénom !");
    return false
    }
    //etc tu fais pareil tu rajoutes des if ..... pour tous les champs text

    return true;
    }
    if(document.GetElementById('tel').value == ""){
    alert("Vous devez remplir le champ téléphone !");
    return false
    }
    //etc tu fais pareil tu rajoutes des if ..... pour tous les champs text

    return true;
    }
    if(document.GetElementById('mail').value == ""){
    alert("Vous devez remplir le champ E-Mail !");
    return false
    }
    //etc tu fais pareil tu rajoutes des if ..... pour tous les champs text

    return true;
    }
    if(document.GetElementById('classement').value == ""){
    alert("Vous devez remplir le champ Classement !");
    return false
    }
    //etc tu fais pareil tu rajoutes des if ..... pour tous les champs text

    return true;
    }
    if(document.GetElementById('club').value == ""){
    alert("Vous devez remplir le champ Club !");
    return false
    }
    //etc tu fais pareil tu rajoutes des if ..... pour tous les champs text

    return true;
    }
    if(document.GetElementById('num').value == ""){
    alert("Vous devez remplir le champ Numero de licence !");
    return false
    }
    //etc tu fais pareil tu rajoutes des if ..... pour tous les champs text

    return true;
    }
    if(document.GetElementById('indisponibilite').value == ""){
    alert("Vous devez remplir le champ Indisponibilité !");
    return false
    }
    //etc tu fais pareil tu rajoutes des if ..... pour tous les champs text

    return true;
    }
    </script>
    <head></head>
    <body><br>

    <form method="post" action="inscription.php" onSubmit="return verif_champs();" >

    <div style="text-align: center;"><big><big><big style="text-decoration: underline;"><span style="font-weight: bold;">Inscrivez vous directement ici !<br>
    <small><br>
    </small></span></big></big></big>
    <div style="text-align: left;"><big><big style="text-decoration: underline;"><span style="font-weight: bold;"></span></big></big><big><big style="text-decoration: underline;"><span style="font-weight: bold;">Remplissez tout les champs pour
    vous inscrire<br>
    <br>
    </span></big><big><span style="font-weight: bold;">Civilité :
           
           
           
           <input type="text" value="" maxlength="15" size="15" name="civilite" id="civilite"></span></big><big style="text-decoration: underline;"><span style="font-weight: bold;"><br>
    <br>
    </span></big><big><span style="font-weight: bold;">Nom
    :       
           
           
           
        <input type="text" value="" maxlength="20" size="20" name="nom" id="nom">   
           
           
           
           
        <br>
    <br>
    Prénom :       
           
           
           <input type="text" value="" maxlength="20" size="20" name="prenom" id="prenom">
           
           
           
           
         <br>
    <br>
    Numéro de téléphone :    
       <input type="text" value="" maxlength="10" size="10" name="tel" id="region"><br>
    <br>
    Adresse E-Mail :    
           
         <input type="text" value="" maxlength="40" size="40" name="mail" id="mail"><br>
    <br>
    Classement :    
           
           
        <input type="text" value="" maxlength="4" size="4" name="classement" id="classement"><br>
    <br>
    Club du licencié :    
           
        <input type="text" value="" maxlength="50" size="50" name="club" id="club"><br>
    </span></big></big><big><big><span style="font-weight: bold;"><br>
    Numéro de licence :       
         </span></big></big><big><big><span style="font-weight: bold;"><input type="text" value="" maxlength="8" size="8" name="num" id="num"></span></big></big><big><big><span style="font-weight: bold;">    
     <br>
    <br>
    </span></big></big><big><big><span style="font-weight: bold;">indisponibilité :
          
           
        <input type="text" value="" maxlength="100" size="100" name="indisponibilite" id="indisponibilite">
           
          
           
          
           
           <br>
    <br>
    </span></big></big>
    <div style="text-align: center;"><big><big><span style="font-weight: bold;"><input value="Valider" type="submit"></a>  
                
                </span></big></big><input value="annuler" type="reset"></div>
    <div style="text-align: center; width: 1097px;">
    <div style="text-align: center;"><big><big><span style="font-weight: bold;"></span></big></big><br>
    </div>
    <big><big><span style="font-weight: bold;"></span></big></big></div>
    <big><big><span style="font-weight: bold;">  
       
            <br>
    <br>
    </span></big></big>
    <div style="text-align: center;"><a href="accueil.html"><font><font face="Arial, sans-serif"><a href="accueil.html"><img style="border: 0px solid ; width: 150px; height: 55px;" alt="" src="boutton_retour.jpg"></a></font></font></a></div>
    <br>
    <big><big><big style="text-decoration: underline;"><span style="font-weight: bold;"></span></big></big></big></div>
    </div>
    </form>

    </body></html>
    0
    1. Alain_42 Messages postés 5413 Statut Membre 904
       
      Bonsoir,

      tuavais fait beaucoup d'erreurs, je te disais der arjouter de if mais il fallait le faire dans la fonction (bref tu avais à chaque fois return true; } en trop

      et qqs erreurs d'id

      comme ça ça fonctionne chez moi:

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <html>
      <head>
      <script language="javascript">
      //fonction verification si champs remplis
      //si le champ est vide, elle fait un message d'alerte et renvoie false donc le formulaire n'est pas envoyé
      //si tous les champs testés par les if ne sont pas vides elle renvoie true et le formulaire est envoyé
      function verif_champs(){
      	if(document.getElementById('civilite').value == ""){
      	alert("Vous devez remplir le champ Civilité !");
      	return false
      	}
      	if(document.getElementById('nom').value == ""){
      	alert("Vous devez remplir le champ Nom !");
      	return false
      	}
      	if(document.getElementById('prenom').value == ""){
      	alert("Vous devez remplir le champ Prénom !");
      	return false
      	}
      	if(document.getElementById('tel').value == ""){
      	alert("Vous devez remplir le champ téléphone !");
      	return false
      	}
      	if(document.getElementById('mail').value == ""){
      	alert("Vous devez remplir le champ E-Mail !");
      	return false
      	}
      	if(document.getElementById('classement').value == ""){
      	alert("Vous devez remplir le champ Classement !");
      	return false
      	}
      	if(document.getElementById('club').value == ""){
      	alert("Vous devez remplir le champ Club !");
      	return false
      	}
      	if(document.getElementById('num').value == ""){
      	alert("Vous devez remplir le champ Numero de licence !");
      	return false
      	}
      	if(document.getElementById('indisponibilite').value == ""){
      	alert("Vous devez remplir le champ Indisponibilité !");
      	return false
      	}
      return true;
      }
      </script>
      </head>
      <body><br>
      <form method="post" action="inscription.php" onSubmit="return verif_champs();" >
      <div style="text-align: center;"><big><big><big style="text-decoration: underline;"><span style="font-weight: bold;">Inscrivez vous directement ici !<br>
      <small><br>
      </small></span></big></big></big>
      <div style="text-align: left;"><big><big style="text-decoration: underline;"><span style="font-weight: bold;"></span></big></big><big><big style="text-decoration: underline;"><span style="font-weight: bold;">Remplissez tout les champs pour
      vous inscrire<br>
      <br>
      </span></big><big><span style="font-weight: bold;">Civilité :
             <input type="text" value="" maxlength="15" size="15" name="civilite" id="civilite"></span></big><big style="text-decoration: underline;"><span style="font-weight: bold;"><br>
      <br>
      </span></big><big><span style="font-weight: bold;">Nom:       
          <input type="text" value="" maxlength="20" size="20" name="nom" id="nom">   
          <br><br>
      Prénom :       
             <input type="text" value="" maxlength="20" size="20" name="prenom" id="prenom">
           <br><br>
      Numéro de téléphone :    
         <input type="text" value="" maxlength="10" size="10" name="tel" id="tel"><br>
      <br>
      Adresse E-Mail :    
           <input type="text" value="" maxlength="40" size="40" name="mail" id="mail"><br>
      <br>
      Classement :    
          <input type="text" value="" maxlength="4" size="4" name="classement" id="classement"><br>
      <br>
      Club du licencié :    
          <input type="text" value="" maxlength="50" size="50" name="club" id="club"><br>
      </span></big></big><big><big><span style="font-weight: bold;"><br>
      Numéro de licence :       
           </span></big></big><big><big><span style="font-weight: bold;">
      	 <input type="text" value="" maxlength="8" size="8" name="num" id="num"></span></big></big><big><big><span style="font-weight: bold;">    
       <br>
      <br>
      </span></big></big><big><big><span style="font-weight: bold;">
      indisponibilité :
          <input type="text" value="" maxlength="100" size="100" name="indisponibilite" id="indisponibilite">
             <br><br>
      </span></big></big>
      <div style="text-align: center;"><big><big><span style="font-weight: bold;">
      <input value="Valider" type="submit"></a>  
                  </span></big></big>
      			<input value="annuler" type="reset"></div>
      <div style="text-align: center; width: 1097px;">
      <div style="text-align: center;"><big><big><span style="font-weight: bold;"></span></big></big><br>
      </div>
      <big><big><span style="font-weight: bold;"></span></big></big></div>
      <big><big><span style="font-weight: bold;">  
              <br><br>
      </span></big></big>
      <div style="text-align: center;"><a href="accueil.html"><font><font face="Arial, sans-serif"><a href="accueil.html"><img style="border: 0px solid ; width: 150px; height: 55px;" alt="" src="boutton_retour.jpg"></a></font></font></a></d­iv>
      <br>
      <big><big><big style="text-decoration: underline;"><span style="font-weight: bold;"></span></big></big></big></div>
      </div>
      </form>
      </body></html>
      
      0
  2. drogba7213 Messages postés 1550 Statut Membre 22
     
    ca marche nikel merci beaucoup alain
    0
Précédent
  • 1
  • 2