IdentifiantMot de passe
Loading...
Mot de passe oubli� ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les r�ponses en temps r�el, voter pour les messages, poser vos propres questions et recevoir la newsletter

JavaScript Discussion :

[Javascript] Php, JS et interne explorer..


Sujet :

JavaScript

Vue hybride

Message pr�c�dent Message pr�c�dent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    21
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2006
    Messages : 21
    Par d�faut [Javascript] Php, JS et interne explorer..
    Bonjour,

    Je suis actuellemen en stage, et je me suis rendu compte que l'application web que j'ai d�velopp�, et qui marchait tr�s ben sous firefox, ne fonctionne pas sous interne explorer.

    Et tou particuli�rement les pages contenant des sripts javascript avec des formulaires html.

    Voici un exmple de fichier m'emb�tant tout particuli�rement :
    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    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
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    	<title>Authentification</title>
    	<link rel="stylesheet" type="text/css" href="style.css" title="d&eacute;faut" />
    </head>
     
    <body class="Main" onload="document.forms['inscription'].elements['nom'].focus()">
     
    <script language="JavaScript" type="text/javascript">
     
          function verif(){
    		if (document.inscription.nom.value.length == 0 ){
    			alert("Veuillez saisir le nom!");
    			return false;
    		}
    		else if (document.inscription.prenom.value.length == 0 ){
    			alert("Veuillez saisir le prénom!");
    			return false;
    		}
    		else if (document.inscription.login.value.length == 0 ){
    			alert("Veuillez saisir le login!");
    			return false;
    		}
    		else if (document.inscription.password.value.length == 0 ){
    			alert("Veuillez saisir le password!");
    			return false;
    		}
    		else if (document.inscription.password.value !=  document.inscription.confirmation.value){
    			alert("Le mot de passe et sa confirmation sont différents!");
    			return false;
    		}
    		else if (document.inscription.num.value.length == 0 ){
    			alert("Veuillez saisir le n° de la rue (0 s'il n'y en a pas)!");
    			return false;
    		}
    		else if (document.inscription.rue.value.length == 0 ){
    			alert("Veuillez saisir le nom de la rue!");
    			return false;
    		}
    		else if (document.inscription.code.value.length == 0 ||isNaN(document.inscription.code.value) || document.inscription.code.value.indexOf(',')>=0 || document.inscription.code.value.indexOf('.')>=0){
    			alert("Veuillez saisir un code postal correct!");
    			return false;
    		}
    		else if (document.inscription.ville.value.length == 0 ){
    			alert("Veuillez saisir la ville!");
    			return false;
    		}
    		else if (document.inscription.tel.value.length == 0){
    			alert("Veuillez saisir le telephone!");
    			return false;
    		}
    		else if (document.inscription.mel.value.length == 0){
    			alert("Veuillez saisir l'adresse mail!");
    			return false;
    		}
    		return true;
    	  }
     
    </script>
     
    <form  action="validationPartenaire.php?id=<? echo $_GET[id] ;?>" method="post" name="inscription"  class="inscription" id="inscription" onsubmit="return verif()">
     
    <error class="Erreur" ><? if (isset($_GET['valid'])) 
    							{$valid=$_GET['valid'];}
        						Else
        						{$valid="";}?>
    <? echo $valid ; ?></error>
     
    <error class="Erreur"><? If (isset($_GET['erreur']))
        {$erreur=$_GET['erreur'];}
        Else
        {$erreur="";}?>
    <? echo $erreur;?></error>
    <h2><U>veuillez remplir le formulaire :</U></h2>
    </br>
    <center>
    <table width="289" height="67" border="1">
    	<td>
    	<h4>Nom partenaire : <font color=red >*</font></h4>
    	<input type="text" name="nom" size="20" maxlength="30" />
    	</form>
    	<h4>Prenom partenaire : <font color=red >*</font></h4>
    	<input type="text" name="prenom" size="20" maxlength="30" />
    	<h4>Exclusivité : </h4>
    	<INPUT TYPE="RADIO" NAME="exclu" VALUE="1" ALT="Oui">OUI
    	<INPUT TYPE="RADIO" NAME="exclu" VALUE="0" checked ALT="NON"> NON
    	<h4>Login : <font color=red >*</font></h4>
    	<input type="text" name="login" size="10" maxlength="15" />
    	<h4>Password : <font color=red >*</font></h4>
    	<input type="password" name="password" size="10" maxlength="10" />
    	<h4>Confirmation du Password : <font color=red >*</font></h4>
    	<input type="password" name="confirmation" size="10" maxlength="15" />
    	<BR>
    	<br />
    	</td>
     
    	<td width="103">
    		<font color=red >* champs obligatoires</font>
     
    		<h4>Adresse Complete : </h4>
     
    		<table width="390" height="67" border="1" align="center">
     
    		 <tr>
    		   <td width="100"><div align="center"><strong>N°</strong></div></td>
    		   <td width="268"><input type="text" name="num" value="0" size="4" maxlength="11" /><BR></td>
    		  </tr>
    		  <tr>
    			<td width="100"><div align="center"><strong>Rue <font color=red >*</font></strong></div></td>
    			<td width="268"><input type="text" name="rue" size="25" maxlength="30" /><BR></td>
    		  </tr>
    		  <tr>
    			<td width="100"><div align="center"><strong>Bât</strong></div></td>
    			<td width="268"><input type="text" name="bat" size="4" maxlength="30" /><BR></td>
    		  </tr><tr>
    			<td width="100"><div align="center"><strong>Appt</strong></div></td>
    			<td width="268"><input type="text" name="appt" size="4" maxlength="20" /><BR></td>
    		  </tr><tr>
    			<td width="100"><div align="center"><strong>Etage</strong></div></td>
    			<td width="268"><input type="text" name="etage" size="4" maxlength="10" /><BR></td>
    		  </tr><tr>
    			<td width="100"><div align="center"><strong>CP <font color=red >*</font></strong></div></td>
    			<td width="268"><input type="text" name="code" size="5" maxlength="5" /><BR></td>
    		  </tr><tr>
    			<td width="100"><div align="center"><strong>Ville <font color=red >*</font></strong></div></td>
    			<td width="268"><input type="text" name="ville" size="10" maxlength="30" /><BR></td>
    		  </tr><tr>
    			<td width="100"><div align="center"><strong>Telephone <font color=red >*</font></strong></div></td>
    			<td width="268"><input type="text" name="tel" size="10" maxlength="10" /><BR></td>
    		  </tr><tr>
    			<td width="100"><div align="center"><strong>Adresse Mail<font color=red >*</font></strong></div></td>
    			<td width="268"><input type="text" name="mel" size="30" maxlength="60" /><BR></td>
    		  </tr><tr>
    			<td width="100"><div align="center"><strong>Fax</strong></div></td>
    			<td width="268"><input type="text" name="fax" size="15" maxlength="10" /><BR></td>
    		  </tr>
    		</table>
    	</td>
    </table>
     
    </center>
    <br />
    <div align="center">
    <input type="image" src="valider.gif" onclick="submit" />	
    </div>
    <br>
    <br>
    <br>
     
     
    </form>
    </body>
    </html>
    Le code n'est pas tr�s compliqu� et c'est cela qui m'emb�te...

    merci d'avance pour vos conseils!

  2. #2
    Inactif  
    Avatar de Kerod
    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    11 672
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2004
    Messages : 11 672
    Par d�faut
    Il faudrait commencer par voir si ca vient pas des document.nomobjet....
    Donc regardes par l� : Comment acc�der aux �l�ments d'un formulaire?

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    21
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2006
    Messages : 21
    Par d�faut
    d'abord merci pour ton aide

    Bon j'ai remplac� mes champs du type document.nomformulaire..... par document.forms['nomformulaire']....

    Mais �a n'a rien chang�.

    L'erreur qui m'est renvoy� sous IE lorsque je clique en bas � gauche sur le petit panneau jaune est: 'submit ets ind�fini' alors qu'il est bien pr�sent.

    Pourtant mon index.php comporte le m�me gene de fonction et fonctionne parfaitement sous IE

    voici son code index.php

    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    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
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    	<title>Authentification</title>
    	<link rel="stylesheet" type="text/css" href="style.css" title="d&eacute;faut" />
    </head>
     
    <body class="Main" onload="document.forms['inscription'].elements['login'].focus()">
     
    <script language="JavaScript" type="text/javascript">
     
          function verif(){
    	  if (document.inscription.login.value.length == 0 ){
              alert("Veuillez saisir votre login!");
    		  return false;
    		  }
    		  else if (document.inscription.password.value.length == 0 ){
              alert("Veuillez saisir votre mot de passe!");
    		  return false;
    		  }
    		  return true;
          }
     
    </script>
     
    <form  action="verifIdentifiant.php" method="post" name="inscription"  class="Bienvenue" id="inscription" onsubmit="return verif()" >
     
    </br>
    <h1 class="Titre"><U>Bienvenue chez Bedo Immobiler </U></h1>
    </br>
    </br>
    </br>
    </br>
    <error class="Erreur" ><?if (isset($_GET['valid'])) ?><? echo $_GET['valid'] ?></error>
     
    <error class="Erreur"><?If (isset($_GET['erreur']))
        {$erreur=$_GET['erreur'];}
        Else
        {$erreur="";}?>
    <? echo $erreur ?></error>
    <h2><U>Veuillez vous identifier :</U></h2>
    </br>
    <table width="289" height="67" border="1">
     
     <tr>
     	<td class="Libelle"><br />
     	  Votre statut :<br />	          </td>
    	<td class="type">
    		      <br />
    		      	<select name="type" >
    		        <option>ADMIN</option>
    		        <option>PARTENAIRE</option>
    		        <option>COMMERCIAL</option>
            		</select>
    		      <br />
    		      <br />      
    	</td>
     
     </tr>
     <tr>
        <td width="103"><div align="center"><strong>LOGIN</strong></div></td>
        <td width="164"><input type="text" name="login" size="20" maxlength="30" /></td>
      </tr>
      <tr>
        <td><div align="center"><strong>PASSWORD</strong></div></td>
        <td><input type="password" name="password" size="20" maxlength="30" /></td>
      </tr>
    </table>
     
    <table width="93" border="1">
      <tr>
        <td width="77"><input type="image" src="valider.gif" onclick="submit" /></td>
      </tr>
    </table>
    </form>
    <table>
    <tr>
    	<td>
    		<a href="changerMotPasse.php"><font color='#222222'>
    		Changer Mot de Passe</font>		</a>	</td>
    </tr>
    </table>
    </body>
    </html>

  4. #4
    Inactif  
    Avatar de Kerod
    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    11 672
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2004
    Messages : 11 672
    Par d�faut
    Attends que je comprenne un peu...Tu soumets ton formulaire sans bouton submit mais avec une image

    D�j� il me semble que le type image est par d�faut un submit mais je comprends pas pourquoi le onclick="submit"...

    Donc retires d�j� ce submit qui n'existe pas et m�me qui n'a rien � faire dans le onclick...Apr�s ca devrait fonctionner tout seul

  5. #5
    Membre averti
    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    21
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2006
    Messages : 21
    Par d�faut
    Je suis d'accord avec toi sur ce point. Mais le onclik="submit" indique bien que submit est d�fini donc je ne devrais as avoir cette erreur....

    Et si je l'enl�ve comment faire pour dire que c'est mon image qui d�fini le submit?

  6. #6
    Inactif  
    Avatar de Kerod
    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    11 672
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2004
    Messages : 11 672
    Par d�faut
    C'est d�j� fait par d�faut et ton truc l� � aucun sens pour moi

    Et ce n'est pas une image mais un input de type image qui fonctionne comme un input submit...

+ R�pondre � la discussion
Cette discussion est r�solue.

Discussions similaires

  1. R�ponses: 17
    Dernier message: 29/04/2008, 21h53
  2. javascript + php
    Par albo69 dans le forum G�n�ral JavaScript
    R�ponses: 16
    Dernier message: 28/01/2006, 12h20
  3. [PHP-JS] passage de variable de javascript � php
    Par msieurx dans le forum Langage
    R�ponses: 5
    Dernier message: 30/10/2005, 20h42
  4. cryptage assymetrique de mot de passe(javascript/PHP)
    Par chess132 dans le forum G�n�ral JavaScript
    R�ponses: 11
    Dernier message: 25/10/2005, 13h04
  5. [Javascript / PHP] Tooltip sur une ligne php
    Par tchoukapi dans le forum G�n�ral JavaScript
    R�ponses: 4
    Dernier message: 21/10/2005, 17h12

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo