Bonjour,
J'ai un problème avec l'affichage sous IE (sous Firefox ca marche nickel).
J'ai un select et des champs input de type texte. Suivant le nombre que je choisis dans le select, les champs input s'affichent ou non grâce à la propriété :
....style.display = "block"; et ...style.display = "none";
Avec IE, lorsque je selectionne un element dans le select, la fonction javascript appelé me cache TOUT les champs (on dirait qu'ils les met tous à none à chaque fois).
Voici mon code :
Merci d'avance !
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 function change_nb_champ() { visible = document.getElementById("nbch").value; i = 1; for(w=1; w <= 5 ; w++) { if(i<=visible) { document.getElementById('l'+i).style.display="block"; } else { document.getElementById('l'+i).style.display="none"; } i++; } } Nombre de Champ : <select id="nbch" name="nbchamp" onChange="change_nb_champ();"> <option>1</option><option>2</option><option>3</option><option>4</option><option>5</option> </select> <br /><br /> Nom du champ Flux Rss<br /> <div id="l1"><input type="text" name="n1"> <input size="70" type="text" name="f1"> <a href="#" onClick="popup('n1');">flux</a></div> <div id="l2"><input type="text" name="n2"> <input size="70" type="text" name="f2"> <a href="#" onClick="popup('n2');">flux</a></div> <div id="l3"><input type="text" name="n3"> <input size="70" type="text" name="f3"> <a href="#" onClick="popup('n3');">flux</a></div> <div id="l4"><input type="text" name="n4"> <input size="70" type="text" name="f4"> <a href="#" onClick="popup('n4');">flux</a></div> <div id="l5"><input type="text" name="n5"> <input size="70" type="text" name="f5"> <a href="#" onClick="popup('n5');">flux</a></div>
Partager