Click to See Complete Forum and Search --> : Toggle all checkboxes


warreng
09-18-2003, 09:47 AM
Question Toggle all checkboxes

I am trying to find a way for a user to select a "Toggle All" option when picking out categories by clicking on checkboxes. There are about 70 categories but I want the user to be able to choose all of them at once if they wanted to .

Please help!!!!!

The form is at this URL:
http://fundraiser-finder.com/fundraising-autofinder.php

pyro
09-18-2003, 09:56 AM
Try something like this:

<script type="text/javascript">
function checkAll() {
for (i=0; i<document.forms[0].elements.length; i++) {
if (document.forms[0].elements[i].type == "checkbox") {
document.forms[0].elements[i].checked = "checked";
}
}
}
</script>