[thelist] check all checkboxes, DOM etc

.jeff jeff at members.evolt.org
Thu Sep 19 14:20:00 CDT 2002


tom,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Tom Dell'Aringa
>
> function checkAllBoxes(targetform)
> {
>   for (i = 0; i < targetform.elements.length; i++)
>   {
>     if (targetform.elements[i].type == "checkbox")
>     {
>       if(targetform.elements[i].checked == false)
>       {
>         targetform.elements[i].checked = true
>       }
>     }
>   }
> }
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

this will work if all the checkboxes have unique names.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> cell.innerHTML = "<input type=\"checkbox\" id=\"box1\"
> class=\"checkbox\" />";
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

do your checkboxes really not have a name attribute?  if not, why not?  do they all really have the same id?  if they do, change your script so they don't as id's must be unique in a document.

get that stuff sorted and come back if you're still not able to get it to work.

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/




More information about the thelist mailing list