ReCoucou,

Voilà je fais suite à mon poste précèdent sur comment faire apparaitre une liste déroulante dans un tableau ...
Ceci est réussi, maintenant je voudrais que lorsque cette liste est apparu et que l'on a fait son choix, elle disparaisse, laissant place au choix écrit dans le tableau.

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
 
<html>
<head>
 <script>
function test(obj){
    if(obj.style.visibility == "visible")
        obj.style.visibility = "hidden";
    else
        obj.style.visibility = "visible";
}
 
function affiche(obj){
        obj.style.visibility = "visible";
}
 
function init(){
    for(var i=0;i<3;i++){
        for(var j=0;j<3;j++){
            var id = 'contenu_'+i+'_'+j;
            document.getElementById(id).style.visibility = "hidden";    
        }
    }
}
 
function gestionListe(obj,divcote,divdebut){
    divcote.innerHTML += obj.value;
    divdebut.style.visibility = "hidden";
}
</script>
</head>
<body onload="init();">
<?php
echo '<table border="1">';
        for($i=0;$i<3;$i++){
            echo '<tr>';
            for($j=0;$j<3;$j++){
                $test = 'contenu_'.$i.'_'.$j;
                $test2 = 'contenu2_'.$i.'_'.$j;
                echo '<td onclick="affiche('.$test.');"><div id="contenu_'.$i.'_'.$j.'" name="contenu_'.$i.'_'.$j.'">
                      <select name="voyant'.$i.'_'.$j.'">';
                           echo '<option onClick="gestionListe(this,'.$test2.','.$test.');">1</option>';
                           echo '<option onClick="gestionListe(this,'.$test2.','.$test.');">2</option>';
                     echo '</select>
                    </div><div id="contenu2_'.$i.'_'.$j.'" name="contenu2_'.$i.'_'.$j.'">&</div></td>';
           }         
           echo '</tr>';
        }
        echo '</table>';?>
        </body>
 
</html>
Mon chiffre apparait dans la div2 mais la première ne disparait pas ???
merci d'avance de votre aide