javascript thread: Trouble with group of checkboxes. Need Help asap
Chris,
this might help.
var list = document.getElementsByName("chkRecipe"); // chkRecipe is the
name/id for all the check boxes
for(i=0;i<list.length;i++)
{
if (list.item(i).checked == true)
{
alert("check box is selected");
// to get the check box selected value use, list.item(i).value
}
else
{
alert("check box is not selected");
}
}
Suresh
-----Original Message-----
From: Chris Cote [mailto:cotec@s...]
Sent: Friday, January 18, 2002 12:12 PM
To: javascript
Subject: [javascript] Trouble with group of checkboxes. Need Help asap
I have a page with 5 checkboxes that have the same name and different
values. I want to check to see if any of the boxes are checked before
continuing to an ASP page. I know about using the checked property for
separate checkboxes, but I wasn't sure how to do it with a group of
checkboxes. Can somebody please help?
Chris
"The information in this email, and in any attachments,
may contain confidential information and is intended
solely for the attention and use of the named addressee(s).
It must not be disclosed to any person without authorization.
If you are not the intended recipient, or a person responsible for
delivering it to the intended recipient, you are not authorized
to, and must not, disclose, copy, distribute, or retain this
message or any part of it."