Re, je suis allé jeter un coup d'oeuil et j'ai testé en local comme me l'a conseillé bultez et dans un premier temps, je pense qu'il faudrai :
- mettre le script entre les balises head
- ne pas mettre l'atribut onchange sur les checkbox mais l'attribut onclick (testé, ça marche !!!)
- ensuite, si tu coche ta checkbox qui dois deselectionner toute les autres si tu clique sur les autres elles ne réagirons pas, il faudra la décocher dabord !!!
Enfin voici le code :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
[ Lien ]">
<html xmlns="
[ Lien ]" xml:lang="fr" lang="fr">
<head>
<title>Mini-chat</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript">
function verif(){
if(document.forms.add.pc_sp.checked == true){
document.forms.add.pc_m.checked = false;
document.forms.add.pc_c.checked = false;
document.forms.add.pc_p.checked = false;
document.forms.add.pc_e.checked = false;
document.forms.add.pc_t.checked = false;
}
if(document.forms.add.pc_m.checked == true || document.forms.add.pc_c.checked == true || document.forms.add.pc_p.checked == true || document.forms.add.pc_e.checked == true || document.forms.add.pc_t.checked == true)
document.forms.add.pc_sp.checked = false;
}
</script>
</head>
<body>
<form action="check.html" method="post" id="add">
<table width="820" cellpadding="2" cellspacing="0" style="padding-left:30px;">
<tr>
<td width="484" class="mgauche centrer">pc_sp
<input name="pc_sp" type="checkbox" id="pc_sp" onclick="verif()" />
Cette case doit pouvoir décocher toute les autre </td>
<td width="326" class="mgauche centrer">pc_p
<input type="checkbox" name="pc_p" id="pc_p" onclick="verif()" />
Décoche pc_sp </td>
</tr>
<tr>
<td class="mgauche centrer">pc_m
<input type="checkbox" name="pc_m" id="pc_m" onclick="verif()" />
Décoche pc_sp </td>
<td class="mgauche centrer">pc_e
<input type="checkbox" name="pc_e" id="pc_e" onclick="verif()" />
Décoche pc_sp </td>
</tr>
<tr>
<td class="mgauche centrer">pc_c
<input type="checkbox" name="pc_c" id="pc_c" onclick="verif()" />
Décoche pc_sp </td>
<td class="mgauche centrer">pc_t
<input type="checkbox" name="pc_t" id="pc_t" onclick="verif()" />
Décoche pc_sp </td>
</tr>
</table>
</form>
</body>
</html>
Si t'a besoin d'aide, MP !!!
