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

HTML Discussion :

XHTML fait planter mon menu déroulant


Sujet :

HTML

  1. #1
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    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
    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 : Sélectionner tout - Visualiser dans une fenêtre à part
    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 : 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
    <!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 =/

  2. #2
    Invité
    Invité(e)
    Par défaut
    Bonjour,
    quand et comment remplis-tu ta 1ère liste ?

  3. #3
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    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
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Level1 = new Array("Pièce de théatre","Chemicals","concert","improvisation");
    avec ça on rempli la première liste

    et si tu remplaces

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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

  4. #4
    Invité
    Invité(e)
    Par défaut
    Le problème d'un doctype strict, c'est qu'il est ... strict.
    -> http://validator.w3.org
    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
    <!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>

  5. #5
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    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
    Par défaut
    Merci pour ta réponse je vais essayer de comprendre tout ça.
    Et de bien étudier les possibilité du doctype.

Discussions similaires

  1. [XHTML] bug XHTML STRICT dans mon menu
    Par dembroski dans le forum Balisage (X)HTML et validation W3C
    Réponses: 3
    Dernier message: 13/08/2007, 17h19
  2. Réponses: 4
    Dernier message: 28/06/2007, 00h05
  3. Mon menu déroulant ne se ferme pas lorsqu'on quitte le champ
    Par sweety107 dans le forum Général JavaScript
    Réponses: 1
    Dernier message: 13/06/2007, 19h41
  4. Mon menu déroulant "wizz" sous IE
    Par koskoz dans le forum Général JavaScript
    Réponses: 1
    Dernier message: 08/06/2007, 11h10
  5. Réponses: 2
    Dernier message: 17/03/2007, 13h43

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