J'ai un formulaire avec des listes déroulantes.
La fonction ne marche pas. Si je remplace Nb1 par Nb2 ça marche pas non plus mais si je mets TypeOp ça marche.
Est ce que qq'un peut me dire pourquoi.
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
32
33
34
35 <Script Language="Javascript"> function Enregistrer(){ var test = document.form0.Nb1.value; alert("Vous avez tapé : " + test); } </Script> <form name="form0" ONRESET="return ResetCheck()"> Selectionnez la transaction <SELECT size=1 name="TypeOp" style="width:100px" style="position: absolute; left:190px;"> <OPTION value="Achat">Achat</OPTION> <OPTION value="Vente">Vente</OPTION> <OPTION value="Ajout">Ajout</OPTION> </SELECT> <br><br> Indiquez le nombre d'opérations <select id="Jours" style="width:50px" style="position: absolute; left:190px;"> </select> <script> elem=document.getElementById("Nb1"); for ( i = 1; i < 50; i++ ) { elem.options[i] = new Option(+ i); } </script> <SELECT id="Nb2" style="width:62px" style="position: absolute; left:345px;"> </select> <script> el=document.getElementById("Nb2"); var tpm = 0; for ( i = 1; i < 350; i++ ) { tmp = i + 100; el.options[i] = new Option(+ tmp); } <input type="button" name="Valid" value="Enregistrer" onclick="Enregistrer()" style="text-align: center" style="position: absolute; left:310px; width:100px"> <input type="reset" value="Effacer" style="text-align: center" style="position: absolute; left:50px; width:100px"> </form>
Partager