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 :

onChange balise select sous IE


Sujet :

JavaScript

  1. #21
    Membre du Club
    Inscrit en
    Mai 2006
    Messages
    93
    Détails du profil
    Informations forums :
    Inscription : Mai 2006
    Messages : 93
    Points : 54
    Points
    54
    Par défaut
    lol ah en fait j'y ai pas pensé !

    Voici ce que j'ai ajouté dans la partie ajax :

    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
     
     
    include("../includes/inc_connexion.php");
     
     
    	$XFiliale = $_GET["filiale"];
    	$navig = $_GET["navig"];
     
     
    	$query = "SELECT bu.XBU, bu.Nom as BU FROM t_business_units bu, t_clients c WHERE bu.XBU = c.YBU AND c.YFiliale = \"$XFiliale\"";
     
     
    	$result = mysql_query($query);
     
     
    	if ($navig == "Microsoft Internet Explorer") {
    		echo "<select name=\"BU\" id=\"BU\" size=\"1\" onChange=\"alert('COUCOU');clearSelect('entite');clearSelect('site');synchroListeClient('BU', 'filiale', '', 'entite');\">";
    	} 
     
    	echo "<option value=\"0\"></option>\n";
     
    	while ($row = mysql_fetch_row($result)) {
    		echo "<option value=\"$row[0]\">$row[1]</option>\n";
    	}
    	if ($navig == "Microsoft Internet Explorer") {
    		echo "</select>";
    	}
    Ce qui est bizar, ne voyant pas d'où cela viens, c'est que quand je choisi ma filiale, il me rempli mes BU (normal) mais en même temps j'ai les listbox Entite et Site qui ont une longueur vide et où je ne peux rien sélectionner dedans :
    Exemple ci-dessous :

    Nom : exempleProb.gif
Affichages : 37
Taille : 2,3 Ko

  2. #22
    Expert éminent sénior

    Homme Profil pro
    Inscrit en
    Janvier 2007
    Messages
    13 474
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Secteur : Finance

    Informations forums :
    Inscription : Janvier 2007
    Messages : 13 474
    Points : 36 571
    Points
    36 571
    Par défaut
    Tapes l'url appelée par Ajax (avec les paramètres) directement dans la barre d'adresse du nav.
    => quel est le résultat ?

    A+
    Pour tout savoir sur l'utilisation du forum

    En postant votre message, n'oubliez pas les Règles du Club.

  3. #23
    Membre du Club
    Inscrit en
    Mai 2006
    Messages
    93
    Détails du profil
    Informations forums :
    Inscription : Mai 2006
    Messages : 93
    Points : 54
    Points
    54
    Par défaut
    Ca semble marcher, il m'affiche la requete :
    SELECT e.XEntite, e.Nom as entite FROM t_entites e, t_clients c WHERE e.XEntite = c.YEntite AND c.YFiliale = "1"AND c.YBU= "1" Resource id #4

    et a coté la listbox avec l'entité dedans.

  4. #24
    Expert éminent sénior

    Homme Profil pro
    Inscrit en
    Janvier 2007
    Messages
    13 474
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Secteur : Finance

    Informations forums :
    Inscription : Janvier 2007
    Messages : 13 474
    Points : 36 571
    Points
    36 571
    Par défaut
    Citation Envoyé par jedi186 Voir le message
    Ca semble marcher, il m'affiche la requete :
    Donc ça ne marche pas.
    Le code de ta requête est renvoyée à ta page, alors qu'il n'a rien à y faire

    A+
    Pour tout savoir sur l'utilisation du forum

    En postant votre message, n'oubliez pas les Règles du Club.

  5. #25
    Membre du Club
    Inscrit en
    Mai 2006
    Messages
    93
    Détails du profil
    Informations forums :
    Inscription : Mai 2006
    Messages : 93
    Points : 54
    Points
    54
    Par défaut
    Tu m'as achevé là lol j'ai mis dans l'url :
    https://gestion/ajax/ajax_entite.php...BU=1&filiale=1

    c'est ce que doit envoyer la fonction javascript.

  6. #26
    Expert éminent sénior

    Homme Profil pro
    Inscrit en
    Janvier 2007
    Messages
    13 474
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Secteur : Finance

    Informations forums :
    Inscription : Janvier 2007
    Messages : 13 474
    Points : 36 571
    Points
    36 571
    Par défaut
    Citation Envoyé par jedi186 Voir le message
    Tu m'as achevé là lol j'ai mis dans l'url :
    https://gestion/ajax/ajax_entite.php...BU=1&filiale=1

    c'est ce que doit envoyer la fonction javascript.
    Ce n'est pas l'appel qui est mauvais, mais la réponse de ta page PHP : elle ne devrait pas renvoyer le texte de la requête ...

    A+
    Pour tout savoir sur l'utilisation du forum

    En postant votre message, n'oubliez pas les Règles du Club.

  7. #27
    Futur Membre du Club
    Profil pro
    Inscrit en
    Juillet 2008
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2008
    Messages : 4
    Points : 5
    Points
    5
    Par défaut
    J'ai une question qui n'a p'etre rien avoir, mais pourquoi y'a un bout de code php (le for) en plein milieu du html dans le 1er c/c de code que tu montre ?

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    <select name='filiale' id='filiale' onChange=\"clearSelect('BU');clearSelect('entite');clearSelect('site');synchroListeClient('filiale', '', '', 'BU')\">	
    		<option value='0'></option>
    		for($i=0; $i < count($lesXFiliales); $i++) {
    			<option value='$lesXFiliales[$i]'";>".$lesNomsFiliales[$i]."</option>
    		}
    	</select>
    Si non moi le lien me fait une erreur.

    Edit:

    Au fait si tu veux afficher des > et < dans la page utilise les codes html c'est a dire &lt; et &gt; (less than et great than) les < > direct dans le code ça peut chier le tout.

  8. #28
    Membre du Club
    Inscrit en
    Mai 2006
    Messages
    93
    Détails du profil
    Informations forums :
    Inscription : Mai 2006
    Messages : 93
    Points : 54
    Points
    54
    Par défaut
    Ben c'est pas une fonction en fait, c'est directement du code dans une page.
    En fait j'ai ma page où il y a le graphique html.
    une page où il y a ma fonction javascript.
    et une autre page où il y a le code pour l'ajax (l'appel de la requête).

    Tu veux dire que mes 'echo' se balade dans la nature sous IE ?

  9. #29
    Membre du Club
    Inscrit en
    Mai 2006
    Messages
    93
    Détails du profil
    Informations forums :
    Inscription : Mai 2006
    Messages : 93
    Points : 54
    Points
    54
    Par défaut
    Salut, tout mon code html est passé en php dans une fonction comme ceci :
    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
    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
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
     
     
    function disp_formAO ($lesXClients, 
    							$lesXFiliales, $lesNomsFiliales,
    							$lesXBUs, $lesNomsBUs,
    							$lesXEntites, $lesNomsEntites,
    							$lesXSites, $lesNomsSites, $lesDepartementsSites,
    						  	$lesXUtilisateurs, $lesNomsUtilisateurs,
    						 	$lesXCorpsEtats, $lesNomsCorpsEtats,
    						 	$lesXSpecialites, $lesNomsSpecialites,
    						  	$lesXMetiers, $lesNomsMetiers,
    						 	$lesXContactsAchats, $lesNomsContactsAchats, 
    						  	$lesXContactsTechniques, $lesNomsContactsTechniques,
     
    						$XAppelOffre, $YClient, $YUtilisateur, $YFiliale, $YBU, $YEntite, $YSite, $YCorpsEtat, $YSpecialite, $YMetier,
    						$YContactAchat, $YContactTechnique, $RefAppelOffre, $DateReception, $Libelle,
    						$DateLimiteReponse, $ReponseGIE) {
     
     
    		// Javascript
     
     
    		$reponse = "";
     
     
    		$reponse .= "<form name='form_Ajout_AO' action='appels_offre.php' method='get'>";
    		$reponse .= "	<table bgcolor='#fee3ca' cellpadding='0' cellspacing='5' border='0'>\n";
    		$reponse .= "	<input type='hidden' name='enregistrerAO' value='0'>";
    		$reponse .= "	<input type='hidden' name='XAppelOffre' value='".$XAppelOffre."'>";
     
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td class='formSousTitre'>Client : </td>";		
    		$reponse .= "		</tr>\n";
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td class='formLibelle'>Filiales : <select name='filiale' id='filiale' onChange=\"clearSelect('BU');clearSelect('entite');clearSelect('site');synchroListeClient('filiale', '', '', 'BU');\">";	
    		$reponse .= "				<option value='0'></option>";
    		for($i=0; $i < count($lesXFiliales); $i++) {
    			$reponse .= "				<option value='$lesXFiliales[$i]'";
    			if ($YFiliale == $lesXFiliales[$i])
    				$reponse .= " 					 ";	
     
    			$reponse .= "					>".$lesNomsFiliales[$i]."</option>";
    		}
    		$reponse .= "			</select><br></td>\n";
    		$reponse .= "			<td class='formLibelle'>Business Units : <select name='BU' id='BU' onChange=\"alert('COUCOU');clearSelect('entite');clearSelect('site');synchroListeClient('BU', 'filiale', '', 'entite');\">";	
    		$reponse .= "				<option value='0'></option>";
    		$reponse .= "				<option value='none'";
    		$reponse .= "					";	
    		$reponse .= "					></option>";
    		$reponse .= "				</select><br></td>\n";
    		$reponse .= "			<td class='formLibelle'>Entités : <select name='entite' id='entite' onChange=\"clearSelect('site');synchroListeClient('entite', 'BU', 'filiale', 'site')\">";	
    		$reponse .= "				<option value='0'></option>";
    		$reponse .= "				<option value='none'";
    		$reponse .= "					 ";	
    		$reponse .= "					></option>";
    		$reponse .= "				</select><br></td>\n";
    		$reponse .= "			<td class='formLibelle'>Sites : <select name='site' id='site' onChange=\"recupContacts('filiale', 'BU', 'entite', 'site', 'contact', 'Achat');recupContacts('filiale', 'BU', 'entite', 'site', 'contact', 'Technique')\">";	
    		$reponse .= "				<option value='none'";
    		$reponse .= "				 ";	
    		$reponse .= "				></option>";
    		$reponse .= "			</select><br></td>\n";
    		$reponse .= "		</tr>\n";
     
     
    		/* FORMULAIRE AJOUT CLIENT */
     
     
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td><a href=\"javascript:afficheId('IdTableAddClient');\">Ajout d'un client : </a></td>\n";	
    		$reponse .= "		<tr>\n";
    		$reponse .= "		<td colspan='4'>\n";
    		$reponse .= "	<table bgcolor='#cca27c' cellpadding='0' cellspacing='5' border='0' align='center' id='IdTableAddClient'>\n";
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td class='formLibelle'>Filiales : <select name='addFiliale' id='addFiliale' >\n";
    		$reponse .= "				<option value='0'></option>";
    		for($i=0; $i < count($lesXFiliales); $i++) {
    			$reponse .= "				<option value='$lesXFiliales[$i]'";
    			if ($YFiliale == $lesXFiliales[$i])
    				$reponse .= " 					 ";	
     
    			$reponse .= "					>".$lesNomsFiliales[$i]."</option>";
    		}
     
    		$reponse .= "			</select><br></td>\n";
     
    		$reponse .= "			<td class='formLibelle'>Business Units : <select name='addBU' id='addBU' >";	
    		$reponse .= "				<option value='0'></option>";
    		for($i=0; $i < count($lesXBUs); $i++) {
    			$reponse .= "				<option value='$lesXBUs[$i]'";
    			if ($YBU == $lesXBUs[$i])
    				$reponse .= " 					 ";	
     
    			$reponse .= "					>".$lesNomsBUs[$i]."</option>";
    		}
    		$reponse .= "			</select><br></td>\n";
     
    		//$reponse .= "			</select><br></td>\n";
    		$reponse .= "			<td class='formLibelle'>Entités : <select name='addEntite' id='addEntite' >";	
    		$reponse .= "				<option value='0'></option>";
    		for($i=0; $i < count($lesXEntites); $i++) {
    			$reponse .= "				<option value='$lesXEntites[$i]'";
    			if ($YEntite == $lesXEntites[$i])
    				$reponse .= " 					 ";	
     
    			$reponse .= "					>".$lesNomsEntites[$i]."</option>";
    		}
    		$reponse .= "			</select><br></td>\n";
     
    		//$reponse .= "			</select><br></td>\n";
    		$reponse .= "			<td class='formLibelle'>Sites : <select name='addSite' id='addSite' >";	
    		$reponse .= "				<option value='0'></option>";
    		for($i=0; $i < count($lesXSites); $i++) {
    			$reponse .= "				<option value='$lesXSites[$i]'";
    			if ($YSite == $lesXSites[$i])
    				$reponse .= " 					 ";	
     
    			$reponse .= "					>".$lesNomsSites[$i].' ('.$lesDepartementsSites[$i].')'."</option>";
    		}
    		$reponse .= "			</select><br></td>\n";
    		$reponse .= "		</tr>\n";	
     
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td colspan='2' class='formLibelle'>Adresse : <INPUT type='text' name='txtAdr1' size='50'></td>\n";
    		$reponse .= "			<td colspan='2' class='formLibelle'>Complément d'adresse : <INPUT type='text' name='txtAdr2' size='40'></td>\n";
    		$reponse .= "		</tr>\n";
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td class='formLibelle'>Code postal : <INPUT type='text' name='txtCP'></td>\n";
    		$reponse .= "			<td class='formLibelle' colspan='3'>Ville : <INPUT type='text' name='txtVille'></td>\n";
    		$reponse .= "		</tr>\n";
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td class='formLibelle'>Téléphone : <INPUT type='text' name='txtTel'></td>\n";
    		$reponse .= "			<td class='formLibelle'>Fax : <INPUT type='text' name='txtFax'></td>\n";
    		$reponse .= "			<td class='formLibelle' colspan='2'>Email : <INPUT type='text' name='txtEmail'></td>\n";
    		$reponse .= "		</tr>\n";		
     
     
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td colspan='4' align='center'><a href='#'>Enregistrer le client</a></td>\n";
    		$reponse .= "		</tr>\n";
     
    		$reponse .= "		</table>\n";
    		$reponse .= "		</td>\n";
    		$reponse .= "		</tr>\n";
    		/**********/
     
    		//$reponse .= "		</tr>\n";
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td colspan='4'><br></td>\n";
    		$reponse .= "		</tr>\n";
     
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td class='formSousTitre' colspan='4'>Contact :</td>\n";
    		$reponse .= "		</tr>\n";
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td class='formLibelle' colspan='4'>Achats : <select name='contactAchat' id='contactAchat'>";	
    		$reponse .= "				<option value='none'";
    		$reponse .= " 					SELECTED ";	
    		$reponse .= "					></option>";
    		$reponse .= "			</select><br></td>\n";
    		$reponse .= "		</tr>\n";	
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td class='formLibelle' colspan='4'>Techniques : <select name='contactTechnique' id='contactTechnique'>";	
    		$reponse .= "				<option value='none'";
    		$reponse .= " 					SELECTED ";	
    		$reponse .= "					></option>";
    		$reponse .= "			</select><br></td>\n";
    		$reponse .= "		</tr>\n";
     
    		/* FORMULAIRE AJOUT CONTACT */
     
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td><a href=\"javascript:afficheId('IdTableAddContact');\">Ajout d'un contact : </a></td>\n";	
    		$reponse .= "		<tr>\n";
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td>\n";
    		$reponse .= "				<table bgcolor='#cca27c' cellpadding='0' cellspacing='5' border='0' align='center' id='IdTableAddContact'>\n";
    		$reponse .= "					<tr>\n";
    		$reponse .= "						<td>\n";
    		$reponse .= "							<select name='addCivilite' id='addCivilite'>\n";
    		$reponse .= "								<option value='Mlle.'>Mlle.</option>\n";
    		$reponse .= "								<option value='Mme.'>Mme.</option>\n";
    		$reponse .= "								<option value='M.'>M.</option>\n";
    		$reponse .= "							</select>\n";
    		$reponse .= "						</td>\n";
    		$reponse .= "						<td>Nom : <INPUT type='text' name='addNomContact' id='addNomContact'></td>\n";
    		$reponse .= "					</tr>\n";
     
     
    		$reponse .= "				</table>\n";
    		$reponse .= "			</td>\n";	
    		$reponse .= "		<tr>\n";		
     
     
    		/* ************************ */
     
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td colspan='4'><br></td>\n";
    		$reponse .= "		</tr>\n";
     
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td class='formLibelle' colspan='4'>Reférence appel d'offre : <input id='test' type='text' name='refAppel' value='".$RefAppelOffre."'></td>\n";
    		$reponse .= "			<td colspan='4'></td>\n";
    		$reponse .= "		</tr>\n";
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td class='formLibelle' colspan='4'>Date réception : <input type='text' name='DateReception' value='".$DateReception."'></td>\n";
    		$reponse .= "		</tr>\n";
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td class='formLibelle' colspan='4'>Libellé : </td>\n";
    		$reponse .= "		</tr>\n";
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td class='formLibelle' colspan='4'><textarea rows='10' cols='100'></textarea></td>\n";
    		$reponse .= "		</tr>\n";
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td class='formLibelle' colspan='4'>Date limite de réponse : <input type='text' name='DateReception' value='".$DateLimiteReponse."'></td>\n";
    		$reponse .= "		</tr>\n";
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td class='formLibelle' colspan='4'>Réponse GIE : <select name=''>";	
    		$reponse .= "				<option value=''";
    		$reponse .= " 				SELECTED ";	
    		$reponse .= "				></option>";
    		$reponse .= "			</select><br></td>\n";
    		$reponse .= "		</tr>\n";
     
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td colspan='4'><br></td>\n";
    		$reponse .= "		</tr>\n";
     
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td class='formLibelle' colspan='4'>Responsable Appel d'offre : <select name='YUtilisateur'>";
    		for ($i=0; $i < count($lesXUtilisateurs); $i++) {
     
    			$reponse .= "<option value='$lesXUtilisateurs[$i]'";
     
    			if ($YUtilisateur == $lesXUtilisateurs[$i])
    				$reponse .= " SELECTED ";
     
    			$reponse .= ">".$lesNomsUtilisateurs[$i]."</option>";
     
    		}
    		$reponse .= "			</select><br></td>\n";
    		$reponse .= "		</tr>\n";
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td class='formLibelle' colspan='4'>Corps d'Etats : <select name='corps_etat' id='corps_etat' onChange=\"clearSelect('specialite');clearSelect('metier');synchroListeReporting('corps_etat', '', 'specialite', 'metier')\">";
    		$reponse .= "				<option value='0'></option>";
    		for ($i=0; $i < count($lesXCorpsEtats); $i++) {	
    			$reponse .= "				<option value='$lesXCorpsEtats[$i]'";
    			if ($YCorpsEtat == $lesXCorpsEtats[$i])
    				$reponse .= " 				SELECTED ";
     
    			$reponse .= "				>".$lesNomsCorpsEtats[$i]."</option>";
    		}
    		$reponse .= "			</select><br></td>\n";
    		$reponse .= "		</tr>\n";
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td class='formLibelle' colspan='4'>Spécialités : <select name='specialite' id='specialite' onChange=\"clearSelect('metier');synchroListeReporting('corps_etat', 'specialite', 'metier', '')\">";	
    		$reponse .= "				<option value='none'";
    		$reponse .= " 				SELECTED ";	
    		$reponse .= "				></option>";
    		$reponse .= "			</select><br></td>\n";
    		$reponse .= "		</tr>\n";
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td class='formLibelle' colspan='4'>Métiers : <select name='metier' id='metier'>";	
    		$reponse .= "				<option value='none'";
    		$reponse .= " 				SELECTED ";	
    		$reponse .= "				></option>";
    		$reponse .= "			</select><br></td>\n";
    		$reponse .= "		</tr>\n";
     
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td colspan='4'><br></td>\n";
    		$reponse .= "		</tr>\n";
     
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td class='formSousTitre' colspan='4'>Fichier associés : </td>\n";
    		$reponse .= "		</tr>\n";
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td class='formLibelle' colspan='4'>Ajout d'un fichier : <INPUT type='file'></td>\n";
    		$reponse .= "		</tr>\n";
     
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td colspan='4'><br></td>\n";
    		$reponse .= "		</tr>\n";
     
    		$reponse .= "		<tr>\n";
    		$reponse .= "			<td align='center' colspan='4'><INPUT class='bouton' type='submit' name='btEnregistrer' value='Enregistrer'> <INPUT class='bouton' type='reset' name='btReset' value='Réinitialiser'></td>\n";
    		$reponse .= "		</tr>\n";
    		$reponse .= "	</table>\n";
    		$reponse .= "</form>";
     
     
    		return $reponse;
     
    	} // disp_formAO()

  10. #30
    Futur Membre du Club
    Profil pro
    Inscrit en
    Juillet 2008
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2008
    Messages : 4
    Points : 5
    Points
    5
    Par défaut
    Si c'est du code que t'a c/c de la source de la page web que crée ton code y'a un pb oui car le for en plein milieu avec des variables php c'est pas normal.

    Et les " sont échappés comme si c'était dans du javascript ou un echo php.

    J'ai l'impression que tu reconstruit entièrement les select, pourquoi ne pas "simplement" récupérer, avec une requete et en ajax, une liste des options et en javascript tout vider et ajouter.

    Genre :

    1#blablalba|2#tata|3#toto

    avec un .split() en javascript tu crée un tableau en séparant tout ce qui a un | et après tu peut encore récupérer le 1er avant le # comme étant l'id de l'option et le 2ème le texte.

    Après j'ai pas tout bien regardé comment t'a fait mais j'ai vu un echo "select.." dans ton code.

  11. #31
    Membre du Club
    Inscrit en
    Mai 2006
    Messages
    93
    Détails du profil
    Informations forums :
    Inscription : Mai 2006
    Messages : 93
    Points : 54
    Points
    54
    Par défaut
    Ben je débute en ajax lol

    mais bon non ya pas de for en plein milieu dans mon code source que voici ci-dessous :

    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
    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
     
     
    <HTML>
    	<HEAD>
    		<title>accueil</title>
    		<META HTTP-EQUIV='pragma' content='no-cache'>
    		<META HTTP-EQUIV='Robots' content='none'>
    		<LINK rel=stylesheet type='text/css' href='css/general.css'>
    		<SCRIPT type='text/javascript' SRC='javascripts/js_AO.php'></SCRIPT>
    		<SCRIPT type='text/javascript' SRC='javascripts/js_general.php'></SCRIPT>
    	</HEAD>
    	<BODY onLoad="javascript:cacheId('IdTableAddClient');">
    		<table cellpadding='0' cellspacing='0' border='1' width='100%' height='100%'>
    			<tr valign='top'>
    				<td style='max-width:203px;width:203px;'>
    <table cellpadding='0' cellspacing='0' align='left' border='0' width='203px' >
    	<tr>
    		<td><a href='appels_offre.php'><img src='images/menu_AO.gif'><a></td>
    	</tr>
    	<tr>
    		<td><a class='AO' href='appels_offre.php?action=1'>Ajouter un appel d'offre<a></td>
    	</tr>
    	<tr>
    		<td><a class='AO' href='appels_offre.php?action=4'>Rechercher<a></td>
    	</tr>
    	<tr>
    		<td><a href='devis.php'><img src='images/menu_D.gif' style='margin-top:10px;'><a></td>
    	</tr>
    	<tr>
    		<td><a href='commandes_c.php'><img src='images/menu_CC.gif' style='margin-top:10px;'><a></td>
    	</tr>
    	<tr>
    		<td><a href='commandes_m.php'><img src='images/menu_CM.gif' style='margin-top:10px;'><a></td>
    	</tr>
    	<tr>
    		<td><a href='factures_c.php'><img src='images/menu_FC.gif' style='margin-top:10px;'><a></td>
    	</tr>
    	<tr>
    		<td><a href='factures_m.php'><img src='images/menu_FM.gif' style='margin-top:10px;'><a></td>
    	</tr>
    	<tr>
    		<td><a href='reporting.php'><img src='images/menu_RA.gif' style='margin-top:10px;'><a></td>
    	</tr>
    </table>
    				</td>
    				<td width='100%'>
    <table cellpadding='0' cellspacing='0' align='left' border='0' width='100%' >
    <tr height='36'>
    	<td width='18'><img src='images/AO_1.gif'></td>
    	<td background='images/AO_2b.gif'><img src='images/AO_2a.gif'></td>
    	<td width='28'><img src='images/AO_3.gif'></td>
    </tr>
    	<tr>
    		<td background='images/cadre_4.gif'></td>
    		<td align='center'><SCRIPT type='text/javascript'>
    		function donneFocus(id)
    {
    // le fait de donner le focus à un élément déplace aussi la fenêtre
    // pour rendre l'élement visible
    var element = document.getElementById(id);
    element.focus();
    }
     
    		</SCRIPT><form name='form_Ajout_AO' action='appels_offre.php' method='get'>	<table bgcolor='#fee3ca' cellpadding='0' cellspacing='5' border='0'>
    	<input type='hidden' name='enregistrerAO' value='0'>	<input type='hidden' name='XAppelOffre' value=''>		<tr>
    			<td class='formSousTitre'>Client : </td>		</tr>
    		<tr>
    			<td class='formLibelle'>Filiales : <select name='filiale' id='filiale' onChange="clearSelect('BU');clearSelect('entite');clearSelect('site');synchroListeClient('filiale', '', '', 'BU');">				<option value='0'></option>				<option value='1'					>a</option>				<option value='4'					>TA</option>				<option value='2'					>toto</option>			</select><br></td>
    			<td class='formLibelle'>Business Units : <select name='BU' id='BU' onChange="alert('COUCOU');clearSelect('entite');clearSelect('site');synchroListeClient('BU', 'filiale', '', 'entite');">				<option value='0'></option>				<option value='none'										></option>				</select><br></td>
    			<td class='formLibelle'>Entités : <select name='entite' id='entite' onChange="clearSelect('site');synchroListeClient('entite', 'BU', 'filiale', 'site')">				<option value='0'></option>				<option value='none'					 					></option>				</select><br></td>
    			<td class='formLibelle'>Sites : <select name='site' id='site' onChange="recupContacts('filiale', 'BU', 'entite', 'site', 'contact', 'Achat');recupContacts('filiale', 'BU', 'entite', 'site', 'contact', 'Technique')">				<option value='none'				 				></option>			</select><br></td>
    		</tr>
    		<tr>
    			<td><a href="javascript:afficheId('IdTableAddClient');">Ajout d'un client : </a></td>
    		<tr>
    		<td colspan='4'>
    	<table bgcolor='#cca27c' cellpadding='0' cellspacing='5' border='0' align='center' id='IdTableAddClient'>
    		<tr>
    			<td class='formLibelle'>Filiales : <select name='addFiliale' id='addFiliale' >
    				<option value='0'></option>				<option value='1'					>a</option>				<option value='4'					>TA</option>				<option value='2'					>toto</option>			</select><br></td>
    			<td class='formLibelle'>Business Units : <select name='addBU' id='addBU' >				<option value='0'></option>				<option value='1'					>Chimie</option>				<option value='3'					>Logistique</option>				<option value='2'					>Plant</option>			</select><br></td>
    			<td class='formLibelle'>Entités : <select name='addEntite' id='addEntite' >				<option value='0'></option>				<option value='2'					>Mecachimie</option>				<option value='1'					>Technoplus Industries</option>			</select><br></td>
    			<td class='formLibelle'>Sites : <select name='addSite' id='addSite' >				<option value='0'></option>				<option value='1'					>Aix en Provence (13)</option>				<option value='2'					>Montpellier (34)</option>			</select><br></td>
    		</tr>
    		<tr>
    			<td colspan='2' class='formLibelle'>Adresse : <INPUT type='text' name='txtAdr1' size='50'></td>
    			<td colspan='2' class='formLibelle'>Complément d'adresse : <INPUT type='text' name='txtAdr2' size='40'></td>
    		</tr>
    		<tr>
    			<td class='formLibelle'>Code postal : <INPUT type='text' name='txtCP'></td>
    			<td class='formLibelle' colspan='3'>Ville : <INPUT type='text' name='txtVille'></td>
    		</tr>
    		<tr>
    			<td class='formLibelle'>Téléphone : <INPUT type='text' name='txtTel'></td>
    			<td class='formLibelle'>Fax : <INPUT type='text' name='txtFax'></td>
    			<td class='formLibelle' colspan='2'>Email : <INPUT type='text' name='txtEmail'></td>
    		</tr>
    		<tr>
    			<td colspan='4' align='center'><a href='#'>Enregistrer le client</a></td>
    		</tr>
    		</table>
    		</td>
    		</tr>
    		<tr>
    			<td colspan='4'><br></td>
    		</tr>
    		<tr>
    			<td class='formSousTitre' colspan='4'>Contact :</td>
    		</tr>
    		<tr>
    			<td class='formLibelle' colspan='4'>Achats : <select name='contactAchat' id='contactAchat'>				<option value='none' 					SELECTED 					></option>			</select><br></td>
    		</tr>
    		<tr>
    			<td class='formLibelle' colspan='4'>Techniques : <select name='contactTechnique' id='contactTechnique'>				<option value='none' 					SELECTED 					></option>			</select><br></td>
    		</tr>
    		<tr>
    			<td><a href="javascript:afficheId('IdTableAddContact');">Ajout d'un contact : </a></td>
    		<tr>
    		<tr>
    			<td>
    				<table bgcolor='#cca27c' cellpadding='0' cellspacing='5' border='0' align='center' id='IdTableAddContact'>
    					<tr>
    						<td>
    							<select name='addCivilite' id='addCivilite'>
    								<option value='Mlle.'>Mlle.</option>
    								<option value='Mme.'>Mme.</option>
    								<option value='M.'>M.</option>
    							</select>
    						</td>
    						<td>Nom : <INPUT type='text' name='addNomContact' id='addNomContact'></td>
    					</tr>
    				</table>
    			</td>
    		<tr>
    		<tr>
    			<td colspan='4'><br></td>
    		</tr>
    		<tr>
    			<td class='formLibelle' colspan='4'>Reférence appel d'offre : <input id='test' type='text' name='refAppel' value=''></td>
    			<td colspan='4'></td>
    		</tr>
    		<tr>
    			<td class='formLibelle' colspan='4'>Dateception : <input type='text' name='DateReception' value=''></td>
    		</tr>
    		<tr>
    			<td class='formLibelle' colspan='4'>Libellé : </td>
    		</tr>
    		<tr>
    			<td class='formLibelle' colspan='4'><textarea rows='10' cols='100'></textarea></td>
    		</tr>
    		<tr>
    			<td class='formLibelle' colspan='4'>Date limite de réponse : <input type='text' name='DateReception' value=''></td>
    		</tr>
    		<tr>
    			<td class='formLibelle' colspan='4'>Réponse GIE : <select name=''>				<option value='' 				SELECTED 				></option>			</select><br></td>
    		</tr>
    		<tr>
    			<td colspan='4'><br></td>
    		</tr>
    		<tr>
    			<td class='formLibelle' colspan='4'>Responsable Appel d'offre : <select name='YUtilisateur'><option value='1'>M. JOE John(ARANERA)</option>			</select><br></td>
    		</tr>
    		<tr>
    			<td class='formLibelle' colspan='4'>Corps d'Etats : <select name='corps_etat' id='corps_etat' onChange="clearSelect('specialite');clearSelect('metier');synchroListeReporting('corps_etat', '', 'specialite', 'metier')">				<option value='0'></option>				<option value='3'				>Electricite</option>				<option value='4'				>Electronique</option>				<option value='1'				>Genie atomique</option>				<option value='2'				>Genie civil</option>				<option value='5'				>Qualite, Securite & Environnement</option>				<option value='6'				>TRANSPORT DE MATIERES DANGEREUSES</option>			</select><br></td>
    		</tr>
    		<tr>
    			<td class='formLibelle' colspan='4'>Spécialités : <select name='specialite' id='specialite' onChange="clearSelect('metier');synchroListeReporting('corps_etat', 'specialite', 'metier', '')">				<option value='none' 				SELECTED 				></option>			</select><br></td>
    		</tr>
    		<tr>
    			<td class='formLibelle' colspan='4'>Métiers : <select name='metier' id='metier'>				<option value='none' 				SELECTED 				></option>			</select><br></td>
    		</tr>
    		<tr>
    			<td colspan='4'><br></td>
    		</tr>
    		<tr>
    			<td class='formSousTitre' colspan='4'>Fichier associés : </td>
    		</tr>
    		<tr>
    			<td class='formLibelle' colspan='4'>Ajout d'un fichier : <INPUT type='file'></td>
    		</tr>
    		<tr>
    			<td colspan='4'><br></td>
    		</tr>
    		<tr>
    			<td align='center' colspan='4'><INPUT class='bouton' type='submit' name='btEnregistrer' value='Enregistrer'> <INPUT class='bouton' type='reset' name='btReset' value='Réinitialiser'></td>
    		</tr>
    	</table>
    </form></td>
    		<td background='images/cadre_6.gif'></td>
    	</tr>
    	<tr>
    		<td background='images/cadre_7.gif' height='19px' width='18px'></td>
    		<td background='images/cadre_8.gif' height='19px' width='*'></td>
    		<td background='images/cadre_9.gif' height='19px' width='28px'></td>
    	</tr>
    </table>
    				</td>
    			</tr>
    		</table>
    	</BODY>
    </HTML>

  12. #32
    Rédacteur/Modérateur

    Avatar de SpaceFrog
    Homme Profil pro
    Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Inscrit en
    Mars 2002
    Messages
    39 640
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 74
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2002
    Messages : 39 640
    Points : 66 670
    Points
    66 670
    Billets dans le blog
    1
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <SCRIPT type='text/javascript' SRC='javascripts/js_general.php'></SCRIPT>
    je sasi que c'est réalisable... juste au cas ou c'est normal ton fichier .php là ?
    Ma page Developpez - Mon Blog Developpez
    Président du CCMPTP (Comité Contre le Mot "Problème" dans les Titres de Posts)
    Deux règles du succès: 1) Ne communiquez jamais à quelqu'un tout votre savoir...
    Votre post est résolu ? Alors n'oubliez pas le Tag

    Venez sur le Chat de Développez !

  13. #33
    Membre du Club
    Inscrit en
    Mai 2006
    Messages
    93
    Détails du profil
    Informations forums :
    Inscription : Mai 2006
    Messages : 93
    Points : 54
    Points
    54
    Par défaut
    Humm oui car mes fonctions javascript sont mises dans un fichier php.
    pourquoi ? tu penses que ça serait mieux de faire directement un .js ?

  14. #34
    Futur Membre du Club
    Profil pro
    Inscrit en
    Juillet 2008
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2008
    Messages : 4
    Points : 5
    Points
    5
    Par défaut
    Hum...

    là tu as ta fonction "synchroListeReporting" qui demande 4 paramètres dont le dernier s'appel "listfin" dans le code de ta fonction tu écrit a la fin :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
      if (navig == "Microsoft Internet Explorer") {
                document.getElementById(listfin).outerHTML = xhr_object.responseText;
            } else {
                document.getElementById(listfin).innerHTML = xhr_object.responseText;
            }
    Mais là dans ton HTML tu l'appel:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <select name='specialite' id='specialite' onChange="clearSelect('metier');synchroListeReporting('corps_etat', 'specialite', 'metier', '')">
    avec '', listfin est donc "null" donc ça va planter sur le getElementById a moins que j'ai mal lut ce qui est possible

  15. #35
    Membre du Club
    Inscrit en
    Mai 2006
    Messages
    93
    Détails du profil
    Informations forums :
    Inscription : Mai 2006
    Messages : 93
    Points : 54
    Points
    54
    Par défaut
    En fait, synchroListeReporting c'est une autre fonction javascript que j'ai adapté de synchroListeClient car elle s'occupe d'autres listbox qui ne fonctionnent pas pareil, mais bon ça me fait le même problème.

    pour simplifier :

    les listbox filiale BU Entite et site découle les une des autres. (synchroListeClient )
    Alors que :

    Corps d'état peut donner une specialité et/ou un métier (synchroListeReporting )

  16. #36
    Futur Membre du Club
    Profil pro
    Inscrit en
    Juillet 2008
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2008
    Messages : 4
    Points : 5
    Points
    5
    Par défaut
    Ok, j'ai pas fait assez attention aux noms de fonctions, par contre y'a un truc que je capte pas dit moi si j'ai bien compris.

    Tu crée une page a partir de php, celle-ci avec des sélect déjà prets avec des ID comme :

    - BU
    - filiale
    - entite
    - site

    Et quand elles sont sélectionné tu lance une fonction JS comme :

    - synchroListeReporting
    - synchroListeClient

    Mai dans celles ci ton code fini par :

    document.getElementById(listfin).outerHTML = xhr_object.responseText;
    } else {
    document.getElementById(listfin).innerHTML = xhr_object.responseText;

    Donc tu remplace le code dans la le select final avec par exemple :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <select name=\"BU\" id=\"BU\" size=\"1\" onChange=\"alert('COUCOU');clearSelect('entite');clearSelect('site');synchroListeClient('BU', 'filiale', '', 'entite');\">
    Je ne suis pas sur que cela crée des bonnes choses de donner un ID a un Select et de modifier le "innerHTML" et de remettre un select.

    Je ne sais pas si ça ne supprime pas que ce qu'il y a entre les balises <Select>

    Au mieux vire les "id" de tes <select> et mets plutot des div genre :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     
    <div id="BU">
     <select bla bla>
     </select>
    </div>
    Qu'en penses-tu ?

  17. #37
    Membre du Club
    Inscrit en
    Mai 2006
    Messages
    93
    Détails du profil
    Informations forums :
    Inscription : Mai 2006
    Messages : 93
    Points : 54
    Points
    54
    Par défaut
    Ouai bonne idée, je vais tenter.
    Puis de toute façon je vais continuer autre chose, sinon j'avance pas.
    De toute façon je tiens au courant de l'avancement des choses

    Merci à tous pour votre aide, si d'autre idées vous viennent, je suis preneur, merci !!

    Jedi186

  18. #38
    Membre du Club
    Inscrit en
    Mai 2006
    Messages
    93
    Détails du profil
    Informations forums :
    Inscription : Mai 2006
    Messages : 93
    Points : 54
    Points
    54
    Par défaut
    Re !

    Tout d'abord merci à tous pour votre temps, car ça marche.

    En fait c'est suicidaire. Si je vous dis qu'il fallait seulement vider les fichiers temporaires et les cookies (pas sur) vous y croyez vous ?

    Personnellement je trouve ça fou, enfin bon !

    Solution 1ère : Vider les fichiers temporaire et les mise à jour !!!

    à la prochaine !


    Jedi186

+ Répondre à la discussion
Cette discussion est résolue.
Page 2 sur 2 PremièrePremière 12

Discussions similaires

  1. onchange sur un select sous IE
    Par Timbermat dans le forum Général JavaScript
    Réponses: 3
    Dernier message: 20/04/2011, 15h32
  2. submit dans une balise select (onchange)
    Par lybhur dans le forum Général JavaScript
    Réponses: 4
    Dernier message: 07/05/2010, 15h23
  3. la balise select et l'évènement onchange !!
    Par m3allem001 dans le forum Balisage (X)HTML et validation W3C
    Réponses: 3
    Dernier message: 10/11/2009, 16h57
  4. balise <select> et attribut focus sous ie et sous firefox
    Par tofito dans le forum Mise en page CSS
    Réponses: 3
    Dernier message: 27/07/2009, 15h09
  5. problème balise p & select sous webmatrix
    Par mappy dans le forum Balisage (X)HTML et validation W3C
    Réponses: 1
    Dernier message: 15/08/2006, 13h55

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