Hi,
I need to have a button that checks all the checkboxes,
and unchecks all checkboxes...
Similar to Select all and De-select all checkbox.
This is the code but doesn't really work. Maybe someone already did this kind functionality.
Hope you can help me w/ this. Thanks in advance.
I need to have a button that checks all the checkboxes,
and unchecks all checkboxes...
Similar to Select all and De-select all checkbox.
This is the code but doesn't really work. Maybe someone already did this kind functionality.
Code:
<script type="text/javascript">
function check_all(group, action)
{
for (var i=0; i<group.length; i++)
group[i].checked = action;
}
</script>
<form>
<INPUT type="button" name="checkall"
value="Select all/Deselect all" onClick="check_all( this.form['checkbox[]'], this.checked )">
<input type="checkbox" name="checkbox[]" value="$file">
<input type="checkbox" name="checkbox[]" value="$file">
<input type="checkbox" name="checkbox[]" value="$file">
</form>