By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,420 Members | 1,245 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,420 IT Pros & Developers. It's quick & easy.

not able to detect a single checkbox.

P: n/a
Hi,

I have a form with checkboxes.

if i do a alert(form.testid.length), it will echo me the number of
chexkboxes

But if there is only a single checkbox, i wouldnt be able to retrieve the
length of the chkbox

for(i=0; i<form.testid.length; i++)
{
if (form.testid[i].checked==true)
{
c = 1;

}
}

pls advise, Thanks

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Feb 7 '07 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Lee
Eric Layman" <namyalcire[at no spam]gmail.comsaid:
>
Hi,

I have a form with checkboxes.

if i do a alert(form.testid.length), it will echo me the number of
chexkboxes

But if there is only a single checkbox, i wouldnt be able to retrieve the
length of the chkbox

for(i=0; i<form.testid.length; i++)
{
if (form.testid[i].checked==true)
{
c = 1;

}
}

pls advise, Thanks
Like most technical newsgroups, this one has a FAQ.
The answer to your frequently asked question is at:
http://www.jibbering.com/faq/#FAQ4_13
--

Feb 7 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.