Script ne fonctionnant pas sous FireFox
Bonjour,
Aujourd'hui comme à chaque fois que je fais des petites bouts de code en javascript ça marche très bien sous IE 7 mais ça ne fonctionne pas sous firefox.
Je ne sais pas où est le problème de compatibilité, j'aurais donc besoin d'un coup de main.
C'est un script qui vérifié que les champs d'un formulaire ont bien été saisie
Merci d'avance
Code:
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 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206
| <head>
<script type='text/javascript'>
function Verif_Info()
{
var msg='Vous devez renseigner les champs suivants : \n';
var ok=0;
if (document.getElementById('Civilite').value==0)
{
ok=1;
msg += '- Civilité \n';
}
if (document.getElementById('Nom').value=="")
{
ok=1;
msg += '- Nom \n';
}
if (document.getElementById('Prenom').value=="")
{
ok=1;
msg += '- Prénom \n';
}
if ((document.getElementById('Jour').value=="")||(document.getElementById('Mois').value=="")||(document.getElementById('Annee').value==""))
{
ok=1;
msg += '- Date de naissance \n';
}
if ((document.getElementById('DptNaissance').value==""))
{
ok=1;
msg += '- Département de naissance \n';
}
if ((document.getElementById('Adresse1').value==""))
{
ok=1;
msg += '- Adresse \n';
}
if ((document.getElementById('CP').value==""))
{
ok=1;
msg += '- CP \n';
}
if ((document.getElementById('Ville').value==""))
{
ok=1;
msg += '- Ville \n';
}
if ((document.getElementById('tel1').value==""))
{
ok=1;
msg += '- Téléphone \n';
}
if ((document.getElementById('email').value==""))
{
ok=1;
msg += '- Adresse Email \n';
}
if (document.getElementById('SituationPro').value==0)
{
ok=1;
msg += '- Situation professionnelle \n';
}
if (document.getElementById('SituationFam').value==0)
{
ok=1;
msg += '- Situation familiale \n';
}
if (document.getElementById('CGV').value=="false")
{
ok=1;
msg += '- Accepter les conditions générales de vente \n';
}
if (ok=1)
{
alert(msg);
}
}
</script>
</head>
<body>
<form action="commande.php" method="post" name="Commande">
<table style="float:left" width="755" border="0">
<tr>
<td width="350"><span class="Style13">
<label>Civilité* :</label>
</span> </td>
<td width="395"><select name="Civilite" size="1">
<option value="0">Sélectionnez</option>
<option value="1">Madame</option>
<option value="2"> Mademoiselle</option>
<option value="3">Monsieur</option>
</select> </td>
</tr>
<tr>
<td><span class="Style13">
<label>Nom* :</label>
</span> </td>
<td><input name="Nom" type="text" style="width:300px"/> </td>
</tr>
<tr>
<td><span class="Style13">
<label>Prénom* :</label>
</span> </td>
<td><input name="Prenom" type="text" maxlength="30" style="width:300px" /> </td>
</tr>
<tr>
<td><span class="Style13">
<label>Date de Naissance (JJ/MM/AAAA)* :</label>
</span></td>
<td><input name="Jour" type="text" maxlength="2" style="width:30px"/>/<input name="Mois" type="text" maxlength="2" style="width:30px"/>/<input name="Annee" type="text" maxlength="4" style="width:50px"/></td>
</tr>
<tr>
<td><span class="Style13">
<label>Département de Naissance (99 si hors France)* :</label>
</span></td>
<td><input name="DptNaissance" type="text" maxlength="5" style="width:60px"/></td>
</tr>
<tr>
<td><span class="Style13">
<label>Adresse (numéro, rue, lieu-dit)* :</label>
</span></td>
<td><input name="Adresse1" type="text" style="width:395px"/></td>
</tr>
<tr>
<td><span class="Style13">
<label>Complément d'adresse (N°Bât., Etage, N°Porte, etc...) : </label>
</span></td>
<td><input name="Adresse2" type="text" style="width:395px"/></td>
</tr>
<tr>
<td><span class="Style13">
<label>Code Postal* : </label>
</span></td>
<td><input name="CP" type="text" maxlength="5" style="width:60px"/></td>
</tr>
<tr>
<td><span class="Style13">
<label>Ville* : </label>
</span></td>
<td><input name="Ville" type="text" style="width:300px"/></td>
</tr>
<tr>
<td><span class="Style13">
<label>Téléphone* :</label>
</span></td>
<td><input name="tel1" type="text" style="width:300px"/></td>
</tr>
<tr>
<td><span class="Style13">
<label>Téléphone (seconde ligne) : </label>
</span></td>
<td><input name="tel" type="text" style="width:300px"/></td>
</tr>
<tr>
<td><span class="Style13">
<label>Email* : </label>
</span></td>
<td><input name="email" type="text" style="width:300px"/></td>
</tr>
<tr>
<td><span class="Style13">
<label>Situation professionnelle* :</label>
</span> </td>
<td>
<select name="SituationPro" size="1">
<option value="0">Sélectionnez</option>
<option value="1">Contrat à Durée Indéterminé</option>
<option value="2">Contrat à Durée Déterminé</option>
<option value="3">Intérim</option>
<option value="4">Profession libérale</option>
<option value="5">Commerçant, Artisan</option>
<option value="6">Sans activité professionnelle</option>
<option value="7">Retraité(e)</option>
<option value="8">Autres</option>
</select> </td>
</tr>
<tr>
<td><span class="Style13">
<label>Situation Familiale* :</label>
</span> </td>
<td>
<select name="SituationFam" size="1">
<option value="0">Sélectionnez</option>
<option value="1">Célibataire</option>
<option value="2">Marié(e)</option>
<option value="3">Union Libre</option>
<option value="4">Veuf(ve)</option>
<option value="5">Divorcé(e)</option>
</select> </td>
</tr>
<tr>
<td colspan="2">
<input name="CGV" type="checkbox" value="false" /> <span class="Style13">
<label><a href="">J'ai lu et j'accepte les conditions générales de ventes</a></label>
</span> </td>
</tr>
<td colspan="2"><input type="button" onclick="Verif_Info();" /></td>
</tr>
</table>
</form>
</body> |