mini_minh
04-13-2007, 12:51 PM
hey was just wondering...if i have like a set of checkboxes or something like...
<input type="checkbox" name="checkbox1"/>
<input type="checkbox" name="checkbox2"/>
<input type="checkbox" name="checkbox3"/>
<input type="checkbox" name="checkbox4"/>
<input type="checkbox" name="checkbox5"/>
how would i write a function to check if the check boxes are checked? like..
function checked()
{
for (i=1; i<= 5; i++)
document.getElementByID("form").....
}
or something like that....
any suggestions?
i know that i can just check each checkbox individually but the checkboxes are created dynamically using an external array and the arrays are of different length so yea...
i need a loop cause theres some values assigned and i need to make a total... like if checkbox is ticked total increases (kind of like a count)
<input type="checkbox" name="checkbox1"/>
<input type="checkbox" name="checkbox2"/>
<input type="checkbox" name="checkbox3"/>
<input type="checkbox" name="checkbox4"/>
<input type="checkbox" name="checkbox5"/>
how would i write a function to check if the check boxes are checked? like..
function checked()
{
for (i=1; i<= 5; i++)
document.getElementByID("form").....
}
or something like that....
any suggestions?
i know that i can just check each checkbox individually but the checkboxes are created dynamically using an external array and the arrays are of different length so yea...
i need a loop cause theres some values assigned and i need to make a total... like if checkbox is ticked total increases (kind of like a count)