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 :

formulaire compatibilité firefox et IE


Sujet :

JavaScript

  1. #1
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Août 2008
    Messages
    85
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2008
    Messages : 85
    Points : 39
    Points
    39
    Par défaut formulaire compatibilité firefox et IE
    Bonjour à tous.

    J'ai un petit souci, le code javascript de mon programme ne fonctionne pas sous firefox alors qu'il marche très bien avec ie.

    Si quelqu'un pourait m'aider, ce serait sympat.

    voici le code :

    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
    		function ClicPaiement()
    		{
    			FormCommande.NumCarteBleue.disabled = FormCommande.Paiement[0].checked;
    		}
     
     
    		function CalculMontant()
    		{
    			var montant = 0;
     
    			for (var i = 0; i<FormCommande.Produits.options.length; i++)
     
    				if(FormCommande.Produits.options[i].selected)
    					montant += PrixProduits[i];
     
    			FormCommande.Montant.value = montant + ' Euros';
    		}

  2. #2
    Expert éminent sénior
    Avatar de Auteur
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    7 650
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 7 650
    Points : 11 143
    Points
    11 143
    Par défaut
    bonjour,

    tu peux nous montrer le code HTML de ton formulaire ?

  3. #3
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Août 2008
    Messages
    85
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2008
    Messages : 85
    Points : 39
    Points
    39
    Par défaut
    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
    <FORM ID = "FormCommande" NAME = "FormCommande" METHOD = "GET" ACTION = "TraiteFormulaire.html" ONSUBMIT = "return CheckData()">
     
    		<TABLE>
     
    				<TR>
    					<TD ALIGN = RIGHT>
    						<LABEL>Nom :</LABEL>
    					</TD>
     
    					<TD ALIGN = LEFT>
    						<INPUT TYPE = "text" ID = "Nom" NAME = "Nom">
    					</TD>
     
    					<TD ROWSPAN = 8 VALIGN = CENTER ALIGN = RIGHT WIDTH = 55%>
    						Montant total de la commande :
    						<INPUT TYPE = "text" ID = "Montant" SIZE = "20" READONLY>
    					</TD>
    				</TR>
     
    				<TR>
    					<TD ALIGN = RIGHT>
    						<LABEL>Prénom :</LABEL>
    					</TD>
     
    					<TD ALIGN = LEFT>
    						<INPUT TYPE = "TEXT" ID = "Prenom" Name = "Prenom">
    					</TD>
    				</TR>
     
    				<TR>
    					<TD ALIGN=RIGHT VALIGN=TOP>
    						<LABEL>Adresse :</LABEL>
    					</TD>
     
    					<TD ALIGN = LEFT>
    						<TEXTAREA ROWS=4 COLS=30 ID="Adresse"></TEXTAREA>
    					</TD>
    				</TR>
     
    				<TR>
    					<TD ALIGN=RIGHT VALIGN=TOP>
    						<LABEL>Comment avez-vous connu notre site ?</LABEL>
    					</TD>
     
    					<TD ALIGN = LEFT>
    						<INPUT TYPE="CHECKBOX" ID="PubSite" NAME="PubSite">
    							Publicité sur un autre site
    						<BR>
    						<INPUT TYPE="CHECKBOX" ID="ListeDiffusion" NAME="ListeDiffusion">
    							Par une liste de diffusion
    						<BR>
    						<INPUT TYPE="CHECKBOX" ID="MoteurRecherche" NAME="MoteurRecherche">
    							Moteur de recherche
    						<BR>
    						<INPUT TYPE="CHECKBOX" ID="Autre" Name="Autre">
    							Autre
    					</TD>
    				</TR>
     
    				<TR>
    					<TD ALIGN=RIGHT VALIGN=TOP>
    						<LABEL>Choisissez vos produits :<BR><I>Touche Ctrl enfoncée pour choix multiples</I></LABEL>
    					</TD>
     
    					<TD ALIGN = LEFT>
    						<SELECT SIZE=6 ID="Produits" NAME="Produits" MULTIPLE ONCHANGE = "CalculMontant()">
     
     
     
     
     
    							<?php
     
    								$serveur = "localhost";
    								$utilisateur = "root";
    								$password = "";
    								$maBase = "html";
     
    								mysql_connect($serveur,$utilisateur,$password);
     
    								mysql_select_db($maBase);
     
    								$result = mysql_query("SELECT Code, Designation FROM `References`");
     
    								while ($row = mysql_fetch_array($result))
    								{
    									echo "<OPTION VALUE =  \"" . $row["Code"] . "\">";
    									echo $row["Designation"] . "</OPTION>";
    								}
     
    							?>
     
     
     
    						</SELECT>
    Voilà le code de mon formulaire.

  4. #4
    Rédacteur

    Avatar de Bovino
    Homme Profil pro
    Développeur Web
    Inscrit en
    Juin 2008
    Messages
    23 647
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2008
    Messages : 23 647
    Points : 91 220
    Points
    91 220
    Billets dans le blog
    20
    Par défaut
    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
    		function ClicPaiement()
    		{
    			document.FormCommande.NumCarteBleue.disabled = document.FormCommande.Paiement[0].checked;
    		}
     
     
    		function CalculMontant()
    		{
    			var montant = 0;
     
    			for (var i = 0; i<document.FormCommande.Produits.options.length; i++)
     
    				if(document.FormCommande.Produits.options[i].selected)
    					montant += PrixProduits[i];
     
    			document.FormCommande.Montant.value = montant + ' Euros';
    		}

  5. #5
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Août 2008
    Messages
    85
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2008
    Messages : 85
    Points : 39
    Points
    39
    Par défaut
    Merci Bovino, Sa marche impécablement.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [CSS 2] Formulaire / Compatibilité Chrome / Firefox
    Par Thib344 dans le forum Mise en page CSS
    Réponses: 6
    Dernier message: 14/06/2012, 15h58
  2. Affichage d'un formulaire sous firefox
    Par caesa dans le forum Balisage (X)HTML et validation W3C
    Réponses: 5
    Dernier message: 06/07/2006, 11h48
  3. Pb de compatibilité Firefox
    Par kiouz dans le forum Général JavaScript
    Réponses: 2
    Dernier message: 07/06/2006, 21h22
  4. Compatibilité Firefox et IE !!
    Par Mike91 dans le forum Général JavaScript
    Réponses: 2
    Dernier message: 09/01/2006, 16h47
  5. [FLASH MX2004] [flashvars] Compatibilité Firefox / IE
    Par CUCARACHA dans le forum Flash
    Réponses: 4
    Dernier message: 20/10/2005, 12h03

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