Need to loop through checkboxes

G

Greg Griffiths

do something like

for (i=0;i<document.myForm.length;i++)
{
if (document.myForm.type=="checkbox")
{
alert("Checkbox");
}
}
 
G

Geoff Lane

Browser: IE5+

I have a form with an unknown number of checkboxes (the page is generated
by a server-side script). I need to loop through those checkboxes, test
whether the name of each checkbox starts with a known string and, if it
does, clear that checkbox.

I've tried just about everything that I can think of, but to no avail.

Can someone tell me how to loop through the checkboxes of a form?

TIA,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top