checkbox all/none now working

This commit is contained in:
Chantal Bernard-Putz 2010-06-23 21:58:44 +00:00
parent aa919ee22e
commit de5c535ac2
2 changed files with 6 additions and 10 deletions

View File

@ -66,7 +66,7 @@ if ($formu) {
include_once("head.php");
?>
<h3><?php printf(_("Deleting files and/or directories")); ?> : </h3>
<form action="bro_main.php" method="post">
<form action="bro_main.php" method="post" name="main" id="main">
<input type="hidden" name="formu" value="2" />
<input type="hidden" name="actdel" value="1" />
<input type="hidden" name="R" value="<?php echo $R?>" />
@ -277,7 +277,7 @@ echo "<table width=\"100%\" style=\"border: 0px\" cellpadding=\"2\" cellspacing=
<tr><th>
<script type="text/javascript">
<!--
document.write("<input type=\"checkbox\" value=\"1\" class=\"inb\" onclick=\"CheckAll();\" />");
document.write("<input type=\"checkbox\" id=\"checkall\" value=\"1\" class=\"inb\" onclick=\"CheckAll();\" />");
// -->
</script>
</th>

View File

@ -97,16 +97,12 @@ function browseforfolder(caller) {
}
function CheckAll() {
var fi = 1;
for (var i = 0; i < document.main.elements.length; i++) {
if(document.main.elements[i].type == 'checkbox'){
if (fi) {
fi=0;
chk=!document.main.elements[i].checked;
chk=document.getElementById('checkall').checked;
for (var i = 0; i < document.main.elements.length; i++) {
if(document.main.elements[i].type == 'checkbox'){
document.main.elements[i].checked = chk;
}
document.main.elements[i].checked = chk;
}
}
}
function hide(s) {