0

In multiple check box, how to add error class if not checked at least once ,

function checkValidate( fieldName )
 {
 var checked = 0; 
 var checkbox = jQuery('.' +fieldName); 
 jQuery(checkbox).each(function(){ 
 if(jQuery(this).prop('checked') == true)
 {
 checked = checked + 1;
 }

});
 if(checked > 0)
 {
 jQuery(checkbox).removeClass('ckbox-err');
 return true;

}
 else 
 {
 jQuery(checkbox).addClass('ckbox-err'); 
 return false;
 }
 }

is this correct……….