Voilà ca fait une heure que je me casse la tête à trouver ce qui ne va pas et je ne trouve pas...![]()
J'ai mon code javascript qui doit vérifier les champs de mon formulaire et rien ne se passe pourquoi aider moi svp en + ca m'enerve de bloquer sur un truc aussi bête![]()
Merci d'avance![]()
voici le code (le reste c'est de l'asp)![]()
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220 <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <html> <head> <meta http-equiv="Content-Language" content="fr"> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Formulaire de recherche</title> <script type='text/javascript' language="JavaScript"> function Retour() { history.go(-1); } function Validator() { if (document.date.value == "") { alert("Tapez une valeur pour le champ date"); return (false); } if (document.date.value.length < 10) { alert("Tapez au moins 10 caractères dans le champ date"); return (false); } if (document.date.value.length > 10) { alert("Tapez au plus 10 caractères dans le champ date"); return (false); } if (document.date2.value == "") { alert("Tapez une valeur pour le champ date2"); return (false); } if (document.date2.value.length < 10) { alert("Tapez au moins 10 caractères dans le champ date2"); return (false); } if (document.annee.value == "") { alert("Tapez une valeur pour le champ annee"); return (false); } if (document.annee.value.length < 4) { alert("Tapez au moins 4 caractères dans le champ annee"); return (false); } if (document.Type1.selectedIndex == 0) { alert("La première option Type1 n'est pas une sélection valide. Choisissez une des autres options."); return (false); } return (true); } </script> </head> <body bgcolor="#FFFFFF" link="#0000FF" vlink="#0000FF" alink="#0000FF"> <% set BaseLink=Server.CreateObject("ADODB.Connection") BaseLink.Open "REX", "RexAdmin", "admrex" %> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1" height="99" bgcolor="#CCCCFF"> <tr> <td width="100%" height="99"> <table border="2" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2" height="54" bgcolor="#FFFFFF"> <tr> <td width="100%" height="54"> <p align="center"><font size="6">Gestion des fiches de retour d'expérience</font><p align="center"><font size="5">Consultation </font></td> </tr> </table> </td> </tr> </table> <p> <font size="2"> <a href="index.asp">Accueil</a> - <a href="index.asp">Identification</a> - Consultation</font><br> </p> </p> <form name="fom" method="POST" onsubmit="return Validator()" language="JavaScript" action ="AffichageDoc.asp"> <center> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="62%" id="AutoNumber3" height="28" bgcolor="#CCCCFF"> <tr> <td width="100%" height="45" colspan="2" align="center"><b><font size="4">Veuillez entrer vos critères de sélection : </font></b> <p align="left"><font size="2" face="Times New Roman"> <font color="#FF0000">*</font>Champ obligatoire </font> </p> <p> </td> </tr> <tr> <td width="100%" height="1" colspan="2" align="center"><p align="center"><font size="4"> <input type="radio" name="Chox1" value="d" checked>Date : entre <input type="text" size=10 name="date" maxlength="10"> et <input type="text" size=10 name="date2" maxlength="10"> </font> <font size="2">(jj/mm/aaaa)</font><font size="4"><br></td> </tr> <tr> <td width="100%" height="69" colspan="2" align="center"> <font size="4">ou</font></td> </tr> <tr> <td width="100%" height="11" colspan="2" align="center"> <p align="center"> <input type="radio" name="Chox1" value="a"><font size="4">Année : </font> <input type="text" size=4 name="annee" maxlength="4"> </font> <font size="2">(aaaa)</font></td> </tr> <tr> <td width="100%" height="19" colspan="2" align="center"> <p align="center"> <p align="center"> <font size="4" face="Times New Roman" color="#FF0000">*</font><font size="4">Type REX : </font> <!--webbot bot="Validation" s-display-name="Type de REX" b-disallow-first-item="TRUE" --><select name="Type1"> <option value="Sélectionnez votre choix">Sélectionnez votre choix</option> <% sql = "SELECT typerex FROM table_typerex" Set RS = Server.CreateObject("ADODB.RecordSet") RS.Open sql, BaseLink do while not RS.eof %> <option value="<%=RS("typerex")%>"><%=RS("typerex")%></option> <% RS.movenext loop%> </select></td> </tr> <tr> <td width="100%" height="19" colspan="2" align="center"> <p align="center"> <p align="center"><font size="4">Origine REX :</font> <select name="Origine1"> <option value="Sélectionnez votre choix">Sélectionnez votre choix</option> <% sql2 = "SELECT originerex FROM table_originerex" Set RS = Server.CreateObject("ADODB.RecordSet") RS.Open sql2, BaseLink do while not RS.eof %> <option value="<%=RS("originerex")%>"><%=RS("originerex")%></option> <% RS.movenext loop%> </select></font></td> </tr> <tr> <td width="50%" height="55" align="center"> <p align="center"> <p align="center"><font size="2" face="Times New Roman"> (</font><u><b><font face="Times New Roman">1)- Plusieurs choix possibles </font> (Bouton control (ctrl) appuyé + click)</b></u><p align="center"> <font size="4"> <b></b> </font> (1)<font size="4">Domaine :</font> <br> <!--webbot bot="Validation" s-display-name="Domaine réglementaire" b-disallow-first-item="TRUE" --><select name="Dom1" multiple> <option value="--Sélectionnez votre choix--">--Sélectionnez votre choix--</option> <% sql3 = "SELECT domainereglementaire FROM table_domainereglementaire" Set RS = Server.CreateObject("ADODB.RecordSet") RS.Open sql3, BaseLink do while not RS.eof %> <option value="<%=RS("domainereglementaire")%>"><%=RS("domainereglementaire")%></option> <% RS.movenext loop%> </select></td> <td width="50%" height="55" align="center"> <p align="left"> <p align="center"> <p align="center">(1)<font size="4">Nature d'installation ou de matériel : <!--webbot bot="Validation" s-display-name="Nature d'installation ou de matériel" b-disallow-first-item="TRUE" --><select name="NatInstal1" multiple size="4"> <option value="--Sélectionnez votre choix--">--Sélectionnez votre choix--</option> <% sql4 = "SELECT natureinstallation FROM table_natureinstallation" Set RS = Server.CreateObject("ADODB.RecordSet") RS.Open sql4, BaseLink do while not RS.eof %> <option value="<%=RS("natureinstallation")%>"><%=RS("natureinstallation")%></option> <% RS.movenext loop%> </select></font></td> </tr> <tr> <td width="100%" height="40" colspan="2" align="center"> <p align="center"><p align="center">(1)<font size="4">Nature de l'incident origine :<br> <!--webbot bot="Validation" s-display-name="Nature de l'incident" b-disallow-first-item="TRUE" --><select name="NatIncid1" multiple> <option value="--Sélectionnez votre choix--">--Sélectionnez votre choix--</option> <% sql5 = "SELECT natureincident FROM table_natureincident" Set RS = Server.CreateObject("ADODB.RecordSet") RS.Open sql5, BaseLink do while not RS.eof %> <option value="<%=RS("natureincident")%>"><%=RS("natureincident")%></option> <% RS.movenext loop%> </select></font></td> </tr> <tr> <td width="100%" height="28" colspan="2" align="center"> <p align="center"> <p align="center"> <input type="submit" value="Valider" name="but"> <input type="button" name="but" value="Retour" onClick="javascript:Retour()"></font></td> </tr> <tr> <td width="100%" height="1" colspan="2" align="center"> </td> </tr> </table> </form> </center> <% RS.close BaseLink.close set BaseLink = nothing set RS = nothing %> </body> </html>
Partager