essayer ce code et SVP pk j'ai tjrs deux Auteur dans ma liste deroulante SVP aider moi
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 <html> <head> <title>la 1ere version de l'application</title> <link href="styles.css" rel="stylesheet" type="text/css"> <script type='text/javascript'> <!-- function ajouteoption(Obj){ var MesOptions=new Array() if(Obj.options[Obj.selectedIndex].innerHTML=="Autres...") { var newText=prompt("entrez le texte de l\'option","") var newOption=document.createElement('option'); newOption.innerHTML=newText lastOption=document.createElement('option') lastOption.innerHTML="Autres..." for(i=0;i<Obj.options.length-1;i++){ MesOptions.push(Obj.options[i]) } MesOptions.push(newOption) MesOptions.push(lastOption) Obj.removeChild(Obj.lastChild) for(i=1;i<MesOptions.length;i++){ Obj.appendChild(MesOptions[i]); } setTimeout(function(){Obj.selectedIndex=Obj.options.length-2},500) } } --> </script> </head> <body> <form action="kkk.php" method="post" name="formulaire"> <select name="structure2" id="monselect" onmouseup="setTimeout(function(){ajouteoption(document.getElementById('monselect'))},100)" size="1"> <option>Direction Génerale</option> <option>--------------------</option> <option>Dir.Info-Comm</option> <option>Dir.Pédagogie</option> <option>Dir.de le Foramtion</option> <option>Secrétariat Génerale</option> <option>Autres...</option> </select> </form> </body> </html>![]()
Partager