Monday, January 08, 2007

How to check whether atleast one checkbox is checked out of multiple checkboxes in a form?

Example:

var selected=false;

for(var i=0; i<frmname.Days.length; i++)
{
if(frmname.Days[i].checked==true)
{
selected=true;
}
}

if(selected==false) {
alert("Please select atleast one");
return false;
}

No comments: