Published:
May 04, 2009check whether any of the checkbox are checked or not
function isChecked(url)
{
f=document.frmName
var checkFound = false;
for (var counter=0; counter < f.length; counter++)
{
if ((f.elements[counter].name == ‘checkBoxId[]’) && (f.elements[counter].checked == true))
{
checkFound = true;
}
}
if (checkFound != true)
{
alert(‘Please check at least one checkbox.’);
return false;
}
else
{
//do something
}
}