laura301019 0 Newbie Poster

Hi does anyone know how i can change the following code so that if theres no checkboxes selected the error message will show.

function checkAllArtists() {
    var checkedValue=document.gridForm.checkAll.checked;
      for (var i=0; i<document.gridForm.elements.length; i++)
         if (document.gridForm.elements[i].type=="checkbox") 
            document.gridForm.elements[i].checked=checkedValue;  
  }

  function countChecked() {
   if (document.gridForm.checkAll.checked <=0)
   alert("Please select an artist");
    return true;

  }

At the minute the error box appears if a box is checked or not.