B onjour à tous !
Je souahite effectuer un test sur les champs d'un formulaire
Ou dois je placer le code pour que cela fonctionne mon code est il correct ?
Merci d'avance pour vos conseils et explications
Jean Marc
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
221
222
223
224
225
226
227
228
229
230
231
232 <script language="jscript"> function control_classe() { if (document.form_ajout.nom_p.value==""); { alert("Veuillez saisir le nom de la personne"); return false; } else { if (document.form_ajout.prenom_p.value=="") { alert("Veuillez saisir le prénom de la personne"); return false; } else { return true; } } } </script> <form action="ajout.php" method="post" enctype="application/x-www-form-urlencoded" name="form_ajout" OnSubmit="return control_classe()"> <tr> <td height="21" colspan="2"><h1>Ajouter une personne</h1></td> </tr> </table> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td class="corps"><td height="56"> <form action="ajouter.php" method="POST" name="form1" OnSubmit="return control_classe()"> <br> <table border="0" cellpadding="0" cellspacing="0" class="conteneur"> <tr valign="top"> <td width="50%"><table border="0" cellpadding="1" cellspacing="0" class="detailMaj" > <tr> <td colspan="2" class="titre">Identité</td> </tr> <tr> <td colspan="2" align="center" ><input type="radio" name="radiobutton" value="monsieur"> Mr <input type="radio" name="radiobutton" value="madame"> Mme <input type="radio" name="radiobutton" value="mademoiselle"> Mlle <input name="id_civ" type="hidden" value="1"></td> </tr> <tr> <th width="22%"><label for="nom">Nom</label></th> <td width="78%"><input name="nom_p" type="text" class="input" size="30" maxlength="32" id="nom"> <span class="obligatoire">*</span></td> </tr> <tr> <th><label for="nomnaissance">Prénom(s)</label></th> <td><input name="prenom_p" type="text" class="input" size="30" maxlength="32" id="prenom"> <span class="obligatoire">*</span> </td> </tr> <tr> <th><label for="commune">Qualité</label></th> <td></label><span class="obligatoire"> <label> <? echo("<select name='qualite' size='1' id='qual_id'>"); while($data=mysql_fetch_array($resultat_qual)){ $type=$data['type']; echo"<option value=\"$type\">$type.</option>"; }; ?> </select> </label> </span></td> </tr> <tr> <th colspan="2"><label for="qualite"><br> </label></th> </tr> <tr> <td colspan="2" class="titre">Adresse</td> </tr> <tr> <td colspan="2" align="center" > </td> </tr> <tr> <th><label for="rue">Rue</label></th> <td><textarea name="nom_rue" cols="30" rows="3" class="input" id="nom"></textarea> <span class="obligatoire">*</span></td> </tr> <tr> <th><label for="code_postal">Code Postal</label></th> <td><input name="cp_com" type="text" class="input" size="5" maxlength="5" id="CP"> <input name="com_id" type="hidden" value="12"></td> </tr> <tr> <th><label for="ville">Ville</label></th> <td><input name="nom_com" type="text" class="input" size="30" maxlength="32" id="ville"></td> </tr> <tr> <th><label for="tel_p">Téléphone</label></th> <td><input type="text" name="tel_ref1" size="10" class="input" id="tel_p"> (Domicile) <span class="obligatoire">*</span></td> </tr> <tr> <th colspan="2"> </th> </tr> <tr> <td colspan="2" class="titre">Association</td> </tr> <tr> <th colspan="2"> </th> </tr> <tr> <th><label for="asso"></label></th> <td> <label></label><span class="obligatoire"><label> <? echo("<select name='asso_id' size='1' id='asso_id'>"); while($data=mysql_fetch_array($resultat)){ $type=$data['nom_a']; echo"<option value=\"$type\">$type.</option>"; }; ?> </select> </label> </span></td> </tr> <tr> <th colspan="2"> </th> </tr> </table></td> <td width="50%"><table border="0" cellpadding="1" cellspacing="0" class="detailMaj" summary="Bloc Referents;"> <tr> <td colspan="2" class="titre">Référent(s) </td> </tr> <tr> <th colspan="2"> </th> </tr> <tr> <th colspan="2"><div align="center">principal</div></th> </tr> <tr> <td colspan="2" align="center" ><input type="radio" name="radiobutton" value="radiobutton"> Mr <input type="radio" name="radiobutton" value="radiobutton"> Mme <input type="radio" name="radiobutton" value="radiobutton"> Mlle</td> </tr> <tr> <th><label for="label5">Nom</label></th> <td><input name="nom_ref1" type="text" class="input" size="30" maxlength="32" id="label5"> <span class="obligatoire">*</span></td> </tr> <tr> <th><label for="label6">Prénom(s)</label></th> <td><input name="Prenom_ref1" type="text" class="input" size="30" maxlength="32" id="label6"> <span class="obligatoire">*</span> </td> </tr> <tr> <th><label for="label6">Fonction</label></th> <td><label> <? echo("<select name='ref_id' size='1' id='ref_id'>"); while($data=mysql_fetch_array($resultat_ref)){ $type=$data['fonction']; echo"<option value=\"$type\">$type.</option>"; }; ?> </select> <span class="obligatoire">*</span></label></td> </tr> <tr> <th><label for="label4">Téléphone</label></th> <td><input type="text" name="tel_ref1" size="10" class="input" id="label4"> (Domicile) <span class="obligatoire">*</span></td> </tr> <tr> <th colspan="2"> </th> </tr> <tr> <th colspan="2"><div align="center">secondaire</div></th> </tr> <tr> <td colspan="2" align="center" ><input type="radio" name="radiobutton" value="radiobutton"> Mr <input type="radio" name="radiobutton" value="radiobutton"> Mme <input type="radio" name="radiobutton" value="radiobutton"> Mlle</td> </tr> <tr> <th><label for="label7">Nom</label></th> <td><input name="nomR2" type="text" class="input" size="30" maxlength="32" id="label7"></td> </tr> <tr> <th><label for="label8">Prénom(s)</label></th> <td><input name="prenomR2" type="text" class="input" size="30" maxlength="32" id="label8"></td> </tr> <tr> <th><label for="label8">Fonction</label></th> <td><input name="fonctionR2" type="text" class="input" size="30" maxlength="32" id="label8"></td> </tr> <tr> <th><label for="label9">Téléphone</label></th> <td><input type="text" name="telR2" size="10" class="input" id="label9"> (Domicile) </td> </tr> <tr> <th height="20" colspan="2"> </th> </tr> </table></td> </tr> </table> <table width="757" border="0" cellpadding="0" cellspacing="0" class="validation" summary="Zone de bouton : Suivant"> <tr> <td height="24"><input name="enregistrer" type="submit" class="bouton" id="Submit" title="Bouton : enregistrer" value="enregistrer"> </td> </tr> </table> </form> <? include("./Templates/production_footer.dwt");?>
Partager