View Single Post
Old 12-30-2008, 04:01 AM   #2 (permalink)
benton
The Contributor
 
Join Date: Apr 2008
Posts: 78
Thanks: 0
benton is on a distinguished road
Default

I was finally able to figure this one out and thought I would post the result here in case others need such a solution. The argument is the name of the main checkbox.
HTML Code:
function ChangeClickedStatus(boxname)
{
  var ison = document.getElementsByName(boxname)[0].checked; 
  var elm = document.getElementsByTagName("input");

  for (j = 0; j < elm.length; j++) 
  {
    if (elm[j].type == 'checkbox')
    {
      if (elm[j].name.search(boxname + "_") == 0)
      {
         if (ison == true)
           elm[j].checked = true;
         else
           elm[j].checked = false;
      }
    } 
  }     
}
benton is offline  
Reply With Quote
The Following 3 Users Say Thank You to benton For This Useful Post:
CoryMathews (12-30-2008), maZtah (01-10-2009), Wildhoney (01-08-2009)