LTLhawk
April 13th, 2008, 05:04 PM
Hi everyone,
I just signed up to this fourm. This site looks like a great reference for help and I appreciate any help I get. Here is my problem. I have a set of checkboxes grouped in fours and the name of the checkboxes is an array. This part works just fine. What I need to do is if the first checkbox is checked, I want the remaining checkboxes only in that section to automaticly get checked. Here is the code that generated the list of checkboxes:
<? for ($x=0 ; $x < $total ; ++$x){ ?>
<? echo " Group $x<br>"; ?>
<input name="alert_home_cat[<? echo $x ?>]" type="checkbox" id="alert_home_cat[<? echo $x ?>]" />
<input name="alert_email_cat[<? echo $x ?>]" type="checkbox" id="alert_email_cat[<? echo $x ?>]" />
<input name="alert_sms_cat[<? echo $x ?>]" type="checkbox" id="alert_sms_cat[<? echo $x ?>]" />
<input name="alert_rss_cat[<? echo $x ?>]" type="checkbox" id="alert_rss_cat[<? echo $x ?>]" />
<br />
<? } ?>
I know that this can be done with javascript, but because I am using an array for the name of the checkboxes I can not seem to get it to work.
Any help is greatly apprecited.
I just signed up to this fourm. This site looks like a great reference for help and I appreciate any help I get. Here is my problem. I have a set of checkboxes grouped in fours and the name of the checkboxes is an array. This part works just fine. What I need to do is if the first checkbox is checked, I want the remaining checkboxes only in that section to automaticly get checked. Here is the code that generated the list of checkboxes:
<? for ($x=0 ; $x < $total ; ++$x){ ?>
<? echo " Group $x<br>"; ?>
<input name="alert_home_cat[<? echo $x ?>]" type="checkbox" id="alert_home_cat[<? echo $x ?>]" />
<input name="alert_email_cat[<? echo $x ?>]" type="checkbox" id="alert_email_cat[<? echo $x ?>]" />
<input name="alert_sms_cat[<? echo $x ?>]" type="checkbox" id="alert_sms_cat[<? echo $x ?>]" />
<input name="alert_rss_cat[<? echo $x ?>]" type="checkbox" id="alert_rss_cat[<? echo $x ?>]" />
<br />
<? } ?>
I know that this can be done with javascript, but because I am using an array for the name of the checkboxes I can not seem to get it to work.
Any help is greatly apprecited.