Hi.
I have a list of checkboxes with Ids that go something like;
chk_AGE=16
chk_AGE=17
chk_AGE=18
chk_GENDER=MALE
chk_GENDER=FEMALE
chk_RANK=OFFICER
chk_RANKE=OTHER
When a user checks/unchecks '16' (for example), I want javascript to look up how many checkboxes in my form have an Id that begins with "chk_AGE" and return the number in an alert box ("3" in this case).
If my user had checked/unchecked "Officer" an alert box would return "2" as there are 2 checkboxes that begin "chk_RANK".
Can someone please help with this? I am a complete javascript beginner.
I have a list of checkboxes with Ids that go something like;
chk_AGE=16
chk_AGE=17
chk_AGE=18
chk_GENDER=MALE
chk_GENDER=FEMALE
chk_RANK=OFFICER
chk_RANKE=OTHER
When a user checks/unchecks '16' (for example), I want javascript to look up how many checkboxes in my form have an Id that begins with "chk_AGE" and return the number in an alert box ("3" in this case).
If my user had checked/unchecked "Officer" an alert box would return "2" as there are 2 checkboxes that begin "chk_RANK".
Can someone please help with this? I am a complete javascript beginner.
Comment