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
|
<head>
<script language="javascript">
function toggleAll(name){
var inputs = document.getElementsByTagName('input');
var count = inputs.length;
for (i = 0; i < count; i++){
_input = inputs.item(i);
if (_input.type == 'checkbox' && _input.id.indexOf('chk-' + name) != -1){
_input.checked = document.getElementById(name + '-all').checked;
}
}
}
</script>
</head>
<?php
echo "<input id = \"chk-option-cot\" name = \"remise_cotisation\" type = \"checkbox\"".$checked_cotisation.">Cotisation</input>";
if($_POST['remise_sejour'] == 'on'){
$checked_sejour = 'checked';
}
echo " <input id = \"chk-option-sej\" name = \"remise_sejour\" type = \"checkbox\"".$checked_sejour.">Séjour</input>";
if($_POST['remise_trier'] == 'on'){
$checked_tri = 'checked';
}
echo " <input id = \"chk-option-tri\" name = \"remise_trier\" type = \"checkbox\"".$checked_tri.">Trier</input>";
if($_POST['remise_cotisation'] == 'on' && $_POST['remise_sejour'] == 'on' && $_POST['remise_trier'] == 'on'){
$checked_tous = 'checked';
}
echo " <input id=\"option-all\" onclick=\"toggleAll('option');\" name = \"remise_tous\" type = \"checkbox\"".$checked_tous.">Tous</input>";
?> |