Bonsoir

J'ai besoin d'aide sur la validation de ce formulaire

je voudrais avant validation que l'on force l'internaute à cocher les trois groupes de boutons radio avant validation

Pourriez vous me donner un coup de pouce sur le javascript merci

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
<HTML><HEAD><TITLE>Calculez votre cotisation avec Comparmut.fr</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="" name=description>
<META content="" name=keywords>
<style>
.titre {
padding-left:10px;
 
}
.text {
font-family:Tahoma;
padding-left:10px;
padding-right:10px;
font-size:10px;
color:#555766;
}
.text2 {
font-size:9px;
font-family:Tahoma;
color:#555766;
vertical-align:center;
}
.text3 {
padding-left:10px;
font-size:9px;
font-family:Tahoma;
color:#555766;
}
.text4 {
font-size:11px;
font-family:Tahoma;
color:#555766;
vertical-align:center;
}
BODY{ 
scrollbar-face-color:#FFFFFF; 
scrollbar-arrow-color:#99CC00; 
scrollbar-track-color:#CCCCCC; 
scrollbar-shadow-color:''; 
scrollbar-highlight-color:''; 
scrollbar-3dlight-color:''; 
scrollbar-darkshadow-Color:''; 
} 
 
</style>
<SCRIPT language=JavaScript>
<!--
 
function SymError()
{
  return true;
}
 
window.onerror = SymError;
 
var SymRealWinOpen = window.open;
 
function SymWinOpen(url, name, attributes)
{
  return (new Object());
}
 
window.open = SymWinOpen;
//-->
 
 
</script>
 
<META content="MSHTML 6.00.2900.2769" name=GENERATOR>
 
<script language="JavaScript"><!--
   function test(garantie) {
    if(garantie[0].checked || garantie[1].checked || garantie[2].checked || garantie[3].checked)
    return true
    alert("Merci de choisir le niveau de votre garantie !")
    return false
   }
 
   function test(option) {
    if(option[0].checked || option[1].checked || option[2].checked )
    return true
    alert("Merci de choisir vos options!")
    return false
   }
      function test(option1) {
    if(option1[0].checked || option1[1].checked || option1[2].checked )
    return true
    alert("Merci de choisir vos options!")
    return false
   }
 
 
//--></script>
</HEAD>
<BODY vLink=#555766 aLink=#555766 link=#555766><br>
 
 
 <FORM method="POST" action="souscription.php"   onSubmit="return test(this.garantie)">
<TABLE cellSpacing=0 cellPadding=0 width=650 align=center border=0>
 
 
 
 
  <TBODY>
    <TR> 
        <TD align=center >&nbsp;</TD>
    <TR> 
        <TD height="2" bgcolor="#F4F4F4"><font style="FONT-SIZE: 13pt" 
      face=Tahoma color=#89A3CA><font color="#666666" size="4"> </font></font> 
          <div style="height:132px; width:740px; overflow:auto;"> 
            <table align="center" width="680">
              <TBODY>
                <TR> 
                  <TD width="231" align=left bgcolor="#99CC00" class="text"><FONT 
            style="FONT-SIZE: 11pt" face="Tahoma" 
            color="#FFFFFF"><strong>Garanties/Formules</strong></FONT></TD>
                  <TD width="90" align=left bgcolor="#99CC00" class="text4"><font color="#FFFFFF"> 
                    <input name="garantie" type="radio" value="niveau1" />
                    </font><FONT color="#FFFFFF"><B>Niveau 1</B></FONT></TD>
                  <TD width="90" align=left bgcolor="#99CC00" class="text4"><FONT color="#FFFFFF"> 
                    <input name="garantie" type="radio" value="niveau1plus" />
                    <B>Niveau 1+</B></FONT></TD>
                  <TD width="90" align=left bgcolor="#99CC00" class="text4"><FONT color="#FFFFFF"> 
                    <input name="garantie" type="radio" value="niveau2" />
                    <B>Niveau 2</B></FONT></TD>
                  <TD width="90" align=left bgcolor="#99CC00" class="text4"><FONT color="#FFFFFF"> 
                    <input name="garantie" type="radio" value="niveau3" />
                    <B>Niveau 3</B></FONT></TD>
                </TR>
                <TR bgcolor="#99CC00"> 
                  <TD align=left style="FONT-SIZE: 11pt" face="Tahoma" 
            color="#FFFFFF" class="text"><strong><font color="#FFFFFF">Option 
                    Facultative 1</font></strong></TD>
                  <TD colspan="4" align=left valign="middle" class="text4"><font color="#FFFFFF"> 
                    <input name="option" type="radio" value="" />
                    Pas d'option &nbsp;&nbsp;&nbsp; 
                    <input name="option" type="radio" value="renfort" />
                    Renfort optique et dentaire&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                    </font></TD>
                </TR>
                <TR bgcolor="#99CC00"> 
                  <TD align=left style="FONT-SIZE: 11pt" face="Tahoma" 
            color="#FFFFFF" class="text"><strong><font color="#FFFFFF">Option 
                    Facultative 2</font></strong></TD>
                  <TD colspan="4" align=left valign="middle" class="text4"><font color="#FFFFFF"> 
                    <input name="option1" type="radio" value="" />
                    Pas d'option &nbsp;&nbsp;&nbsp; 
                    <input name="option1" type="radio" value="medecine" />
                    M&eacute;decine naturelle</font></TD>
                </TR>
              <br>
            </table>
        </div></font></font>
          </TR>
    <TR> 
      <TD height="2" bgcolor="#F4F4F4"><div align="center"><br><input type="Submit" value="OK">
 
          </div>
          </TR>
    <TR>
      <TD height="2" bgcolor=""><div align="center"><font color="#555766" size="1" face="Tahoma"> 
            </font></div></TR>
  </TBODY>
</TABLE></FORM>
<br>
 
        </BODY></HTML>