Menu
All,
I have the following code which validates a form has at least one checkbox checked before it submits it. However I want to make sure that there aren’t more then 25 checked on the page. How can I do this?
[CODE]
function validate(field)
{
for (var i = 0; i < field.length; i++){
if(field[i].checked){ // if a field is checked form is submitted
return true;
}
}
alert(“You need to have a check box selected to submit the form!”);
return false; // if no fields are checked form not submitted
}
Thanks in advance!