Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > HTML / DHTML / XHTML
HTML / DHTML / XHTML Forum sur la programmation HTML / DHTML/ XHTML et la validation W3C. Cours (X)HTML, FAQ (X)HTML
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 30/08/2011, 19h35   #1
Invité de passage
 
Homme
Étudiant
Inscription : août 2011
Messages : 3
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : Belgique

Informations professionnelles :
Activité : Étudiant
Secteur : High Tech - Multimédia et Internet

Informations forums :
Inscription : août 2011
Messages : 3
Points : 0
Points : 0
Par défaut XHTML fait planter mon menu déroulant

Bonjour à vous,

Alors voila mon problème, du a une colorbox j'ai du rajouter les lignes suivante à mon code pour qu'elle fonctionne correctement:
Code :
1
2
3
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Sauf qu'après cela mon menu déroulant devient vide. J'ai fait une petit exemple:

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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 
 
<script Language="javascript">
 
Level1 = new Array("Pièce de théatre","Chemicals","concert","improvisation");
 
Ceramics = new Array("ELECTRONICS","ENVIRONMENTAL");
Chemicals = new Array("METALLIC SOAPS","OLEOCHEMICAL_DERIVATIVES");
 
 
ELECTRONICS = new Array("Solder mask");
ENVIRONMENTAL = new Array("Catalysts")
 
METALLICSOAPS = new Array("Soap","Translucent soaps","Liquid soap");
OLEOCHEMICAL_DERIVATIVES = new Array("FA-pos","FA polfaideriv");
 
 
function fillSelect(isValue,isNext){
isNext.style.display = "";
isNext.length = 1;
var curr = window[isValue.replace(/\s/g,'')]; 
for (var zxc0=0;zxc0<curr.length;zxc0++) {
isNext.options[zxc0+1]= new Option(curr[zxc0],curr[zxc0],true,true)
}
isNext.selectedIndex=0;
}
 
function getValue(isValue){
 
}
 
</script>
</Head>
 
<body>
<center>
<h4>Dependent Select List, within a form</h4>
<Form name='Categories'>
<p>Industry segment <Select name='List1' onChange="fillSelect(this.value,Categories.List2)">
<option selected>Make a selection</option>
</Select>
</p>
<Select name='List2' onChange="fillSelect(this.value,Categories.List3)">
<option selected>Make a selection</option>
</Select>
<p></p>
<Select name='List3' onChange="getValue(this.value)">
<option selected >Make a selection</option>
</Select>
</Form>
</center>
<script>
fillSelect('Level1',Categories.List1);
Categories.List2.style.display = "none";
Categories.List3.style.display = "none";
</script>
 
 
</body>
 
</html>
Et je ne comprend pas du tout ou est l'erreur =/
Nhurgh est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 30/08/2011, 20h10   #2
Rédacteur
 
Avatar de jreaux62
 
Homme Jérôme Réaux
Webdesigner
Inscription : août 2008
Messages : 2 994
Détails du profil
Informations personnelles :
Nom : Homme Jérôme Réaux
Âge : 45
Localisation : France, Pas de Calais (Nord Pas de Calais)

Informations professionnelles :
Activité : Webdesigner
Secteur : Arts - Culture

Informations forums :
Inscription : août 2008
Messages : 2 994
Points : 5 787
Points : 5 787
Envoyer un message via Skype™ à jreaux62
Bonjour,
quand et comment remplis-tu ta 1ère liste ?
__________________
"Ce qui se conçoit bien s'énonce clairement - Et les mots pour le dire arrivent aisément."
Nicolas Boileau-Despréaux, Homme de lettres français (1636-1711), principal théoricien de l'esthétique classique.
Site perso Mes tutos DVP : Gestion-Affichage de Nouvelles - Affichage en tableau HTML - Fonctions de redimensionnement d'images
jreaux62 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 30/08/2011, 20h39   #3
Invité de passage
 
Homme
Étudiant
Inscription : août 2011
Messages : 3
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : Belgique

Informations professionnelles :
Activité : Étudiant
Secteur : High Tech - Multimédia et Internet

Informations forums :
Inscription : août 2011
Messages : 3
Points : 0
Points : 0
Code :
Level1 = new Array("Pièce de théatre","Chemicals","concert","improvisation");
avec ça on rempli la première liste

et si tu remplaces

Code :
1
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
par <html>

la page fonctionne comme elle devrait
Nhurgh est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 30/08/2011, 23h21   #4
Rédacteur
 
Avatar de jreaux62
 
Homme Jérôme Réaux
Webdesigner
Inscription : août 2008
Messages : 2 994
Détails du profil
Informations personnelles :
Nom : Homme Jérôme Réaux
Âge : 45
Localisation : France, Pas de Calais (Nord Pas de Calais)

Informations professionnelles :
Activité : Webdesigner
Secteur : Arts - Culture

Informations forums :
Inscription : août 2008
Messages : 2 994
Points : 5 787
Points : 5 787
Envoyer un message via Skype™ à jreaux62
Le problème d'un doctype strict, c'est qu'il est ... strict.
-> http://validator.w3.org
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />
	<title>Test</title>
 
	<script type="text/javascript">
	// listes deroulantes
	var Level1 = new Array("Pièce de théatre","Chemicals","concert","improvisation");
	var Ceramics = new Array("ELECTRONICS","ENVIRONMENTAL");
	var Chemicals = new Array("METALLIC SOAPS","OLEOCHEMICAL_DERIVATIVES");
	var ELECTRONICS = new Array("Solder mask");
	var ENVIRONMENTAL = new Array("Catalysts");
	var METALLICSOAPS = new Array("Soap","Translucent soaps","Liquid soap");
	var OLEOCHEMICAL_DERIVATIVES = new Array("FA-pos","FA polfaideriv");
	// remplissage Select
	function fillSelect(isValue,isNext){
		var isValue;
		var isNext = document.getElementById(isNext);
		isNext.style.display = "";
		isNext.length = 1;
		var tableau = window[isValue.replace(/\s/g,'')];
		for (var zxc0=0; zxc0<tableau.length; zxc0++) {
			isNext.options[zxc0+1] = new Option(tableau[zxc0],tableau[zxc0],true,true);
		}
		isNext.selectedIndex = 0;
	}
	function initselect() {
		document.getElementById('idList2').style.display = "none";
		document.getElementById('idList3').style.display = "none";
		// remplissage Select List1
		fillSelect('Level1','idList1');
	}
	function getValue(isValue){
 
	}
	</script>
 
</head>
 
<body onload="initselect();">
<div style="text-align:center;">
	<h4>Dependent Select List, within a form</h4>
	<form method="post" action="">
		<p>Industry segment 
			<select id="idList1" name="List1" onchange="fillSelect(this.value,'idList2');">
				<option selected="selected">Make a selection</option>
			</select>
		<p>
		</p>
			<select id="idList2" name="List2" onchange="fillSelect(this.value,'idList3');">
				<option selected="selected">Make a selection</option>
			</select>
		<p>
		</p>
			<select id="idList3" name="List3" onchange="getValue(this.value);">
				<option selected="selected">Make a selection</option>
			</select>
		</p>
	</form>
</div>
 
</body>
 
</html>
__________________
"Ce qui se conçoit bien s'énonce clairement - Et les mots pour le dire arrivent aisément."
Nicolas Boileau-Despréaux, Homme de lettres français (1636-1711), principal théoricien de l'esthétique classique.
Site perso Mes tutos DVP : Gestion-Affichage de Nouvelles - Affichage en tableau HTML - Fonctions de redimensionnement d'images
jreaux62 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 31/08/2011, 19h48   #5
Invité de passage
 
Homme
Étudiant
Inscription : août 2011
Messages : 3
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : Belgique

Informations professionnelles :
Activité : Étudiant
Secteur : High Tech - Multimédia et Internet

Informations forums :
Inscription : août 2011
Messages : 3
Points : 0
Points : 0
Merci pour ta réponse je vais essayer de comprendre tout ça.
Et de bien étudier les possibilité du doctype.
Nhurgh est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 21h29.


 
 
 
 
Partenaires

Hébergement Web