Bonjour,

J'ai un formulaire avec divers champs. Lorsque j'envoi ce formulaire, ca va vers une page qui insere ces données dans une base mysql.

J'aimerai rendre des champs obligatoires, j'ai essayé plusieurs méthodes mais cela ne fonctionne pas:

Ca m'envoie quand meme mes données vers ma base mysql.

Je vous montre mon code
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
 
<html>
<head>
<script>
 
    <div class="formulaire">
  <table width="599" border="0" class="texte_formulaire">
    <form method="post" action="verif_test.php">
 <tr><td>&nbsp;</td></tr>
      <tr><td align="center" height="25" colspan="2" class="titre_formulaire"><b>Inscription de votre location</b></td></tr>
   <tr><td>&nbsp;</td></tr>
   <tr> 
        <td>Titre de votre location</td>
        <td> <input type="text" name="nomGite" value="" maxlength="70" size="50"></td>
      </tr>
      <tr> 
        <td>&nbsp;</td>
      </tr>
      <tr> 
        <td>Description</td>
        <td> <textarea name="descriptionGite" onKeyUp="limite(this,255);" onKeyDown="limite(this,255);" maxlenght="255" cols="49" rows="8"></textarea></td>
      </tr>
      <tr> 
        <td>Région</td>
        <td> <select  name="dptGite" size="1" >
   <option>---------Région---------</option>
            <option value="Alsace">Alsace</option>
            <option value="Aquitaine">Aquitaine</option>
            <option value="Auvergne">Auvergne</option>
            <option value="Basse Normandie ">Basse Normandie </option>
            <option value="Bourgogne">Bourgogne</option>
            <option value="Bretagne">Bretagne</option>
                     </select></td>
      </tr>
      <tr> 
        <td>Département</td>
        <td> <select name="regionGite" size="1" >
   <option>----------Département----------</option>
            <option value="Ain">Ain</option>
            <option value="Aisne">Aisne</option>
 
          </select></td>
      </tr>
         </tr>
 
    <tr><td colspan="2" class="titre_formulaire">Contact</td></tr>
       <tr> 
        <td  >Nom</td>
        <td><input type="text" name="nomProprio" value="" maxlength="50" size="50"></td>
      </tr>
      <tr> 
        <td>Mail</td>
        <td><input type="text" name="mailProprio" value="" maxlength="70" size="50"></td>
      </tr>
      <tr> 
        <td>Téléphone</td>
        <td> <input type="text" name="telProprio" value="" maxlength="20" size="50"></td>
      </tr>
      <tr> 
        <td>Site</td>
        <td><input type="text" name="siteProprio" value="http://" maxlength="70" size="50"></td>
      </tr>
      <tr> 
   <tr><td>&nbsp;</td></tr>
        <td colspan="2" align="center"><input type="submit" name="envoi" value="envoi!"></td>
      </tr>
   <tr><td>&nbsp;</td></tr>  </form>  
    </table>
</div>
</body>
</html>
Merci de votre aide