intenta con esta función:
function validate_checkboxes()
{
var inputs = document.getElementsByTagName('input'),
unmarked = {},
errors = [];
[].forEach.call(inputs, function(checkbox)
{
var name = checkbox.getAttribute('name'),
type = checkbox.getAttribute('type');
if(type !== 'checkbox')
return;
if( !checkbox.checked )
{
if(!unmarked[name])
unmarked[name] = [];
unmarked[name].push(checkbox);
}
});
for(name in unmarked)
{
var count = unmarked[name].length,
group_name = name.replace('[]', '');
errors.push('te falta marcar %1 campo%2 en el grupo %3%4'.replace(/\%(\d)/g, function(str, format)
{
return [
count,
count > 1 ? 's' : '',
group_name,
"\n"
][format-1];
}));
}
if(errors.length)
{
// alert(errors.join("\n"));
document
.getElementById('errors')
.innerHTML = errors.join('<br>');
document
.getElementById('errors')
.style.display = 'block';
}
else
{
document
.getElementById('errors')
.style.display = 'none';
}
return !!!errors.length;
}
http://jsfiddle.net/2L02sxkt/1/