Bonjour,
Pourriez vous me donner la syntax pour controler qu'un radio bouton est cocher et que au moins un check box est coché.

Voici mon formulaire.

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
 
<label  for="locomotion" ><span style= "font-family:Comic Sans; font-size:12pt; font-style:italic;">Quel moyen de locomotion avez-vous?</span></label><br>
				                                     <label class="labelradio" for="locomotion"><input class="radio" type="radio" value="sans" name="locomotion" id="locomotionsans"/>Sans</label>
				                                        <label class="labelradio" for="locomotion"><input class="radio" type="radio" value="voiture" name="locomotion" id="locomotionvoiture"  />Voiture</label>
				                                        <label class="labelradio" for="locomotion"><input class="radio" type="radio" value="Moto" name="locomotion" id="locomotionmoto" />Moto</label> 
														<label class="labelradio" for="locomotion"><input class="radio" type="radio" value="Scooter" name="locomotion" id="locomotionscooter" />Scooter</label> 
				                                        <label class="labelradio" for="locomotion"><input class="radio" type="radio" value="Velo" name="locomotion" id="locomotionvelo" />Velo</label> 
				                                         <span id="azerty"></span> <span class="error-message"> Erreur</span>
														<br>
 
				                                        <div class="cleared"></div> 
				                                        <P></p>
 
				                                        <label  for="checkbox" ><span style= "font-family:Comic Sans; font-size:12pt; font-style:italic;">Horaires acceptees : </span></label> <br>
														<label class="labelcheckbox" for="locomotion"><input name="horaire[]" type="checkbox" value="Journee">Journee </label>
														<label class="labelcheckbox" for="locomotion"><input name="horaire[]" type="checkbox" value="nuit">Nuit </label>
														<label class="labelcheckbox" for="locomotion"><input name="horaire[]" type="checkbox" value="weekend">Week-end </label>
														<label class="labelcheckbox" for="locomotion"><input name="horaire[]" type="checkbox" value="2x7">Matin / Apres-midi </label>
														<label class="labelcheckbox" for="locomotion"><input name="horaire[]" type="checkbox" value="3x7">Matin / Apres-midi / Nuit </label>
														<label class="labelcheckbox" for="locomotion"><input name="horaire[]" type="checkbox" value="5x7">Matin / Apres-midi / Nuit / WE </label>
														<span class="error-message"> Erreur</span>
et ma partie javascript
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
 
<SCRIPT type="text/javascript" language="Javascript" src="jquery.js"></script>
	<SCRIPT type="text/javascript">
$(function() {
 
		$("#envoyer").click(function(){
			valid = true;
 
			if($('input[name="locomotion"]:checked').val() == ""){
				$("#azerty").next(".error-message").fadeIn().text("Veuillez selectionner un moyen de locomotion");
				valid = false;
				}
				else{
				$("#azerty").next(".error-message").fadeOut();
				}
return valid;
				});
.
Rien ne se passe.
Pour les checkbox je ne sais pas qu'elle doit etre la condition a mettre dans le if.

Merci