» Select All Checkboxes Button by falsepride |
|
(Login to remove green text ads)
When making a form for a list of files for example, you might want to put a check box next to each file and delete the selected files. If you want to select all of the checkboxes in one form, you can make a select all button by doing:
HTML Code:
<SCRIPT LANGUAGE="JavaScript">
document.deleteform.allbox.onclick = un_check;
function un_check(){
for (var i = 0; i < document.deleteform.elements.length; i++) {
var e = document.deleteform.elements[i];
if ((e.name != 'allbox') && (e.type == 'checkbox')) {
e.checked = document.deleteform.allbox.checked;
}
}
}
</SCRIPT>
You should replace deleteform with the name of your form, and allbox with the name of your select all check box
|
|