[thelist] check all checkboxes, DOM etc

Tom Dell'Aringa pixelmech at yahoo.com
Thu Sep 19 14:47:01 CDT 2002


--- ".jeff" <jeff at members.evolt.org> wrote:
> 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.

Yeah, pardon my poor programming - this was supposed to be a really
sketchy demo at first, now they want it to work as a static page like
it will work when its a real functioning dynamic page. So wasn't
concerned with all the details at first (please don't think I write
code like this!)..let me try and fill it out and see if it works....

=====
var me = tom.pixelmech.webDeveloper();

http://www.pixelmech.com/
http://www.maccaws.com/
[Making A Commercial Case for Adopting Web Standards]

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com



More information about the thelist mailing list