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
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script src = "scripts/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(function()
{
$("#checks input[type=checkbox]").click(function()
{
if ($(this).attr("class") == "block1")
{
$("#checks .block2").attr('checked', false);
}
else if ($(this).attr("class") == "block2")
{
$("#checks .block1").attr('checked', false);
}
});
})
</script>
</head>
<body>
<form action="#" method = "post">
<p id = "checks">
<input class="block1" type = "checkbox" name = "checkA" value = "A" />
<input class="block1" type = "checkbox" name = "checkB" value = "B" />
<input class="block2" type = "checkbox" name = "checkC" value = "C" />
<input type = "submit" name = "envoyer" value = "envoyer" />
</p>
</form>
</body>
</html> |
Partager