title: getting validation to check boxes
body: <p>Hello all: I recently stumbled upon a question about form validation, which I'm currently trying to get working. I got the code from an answer and then customized it to more what I'm needing.:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript"&gt;
  function Validate(){
     if(!validateForm()){
         alert("Something happened");
         return false;
     }
  return true
  }
  function validateForm()
  {
      var c=document.getElementsByTagName('input');
      for (var i = 0; i&lt;c.length; i++){
          if (c[i].type=='checkbox')
          {
              if (c[i].checked){return true}
          }
      }
      return false;
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form name="myForm" action="http://upload.wikimedia.org/wikipedia/commons/3/30/Googlelogo.png" onsubmit="return Validate()" method="get"&gt;
  &lt;input type="checkbox" name="live" value="yesno"&gt;You are alive.
  &lt;br&gt;
  &lt;input type="checkbox" name="type" value="person"&gt;You are a person.
  &lt;br&gt;
  &lt;input type="checkbox" name="eyes" value="color"&gt;Your eyes have color.
  &lt;br&gt;
  &lt;input type="submit" value="Submit"&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>NOTE: The image is just from a Google Image Search, and is on Wikipedia (I do not own it).</p>
  
  <p>Now, when I originally entered the HTML from the answer into the Tryit Editor at W3 Schools, it would give me a "Something Happened" alert, or do nothing. (I think that's what is was supposed to do). 
  Still, (now that I have my own questions) it will say "something happened" if nothing is selected, but no matter how many check (over 1 checked) it will just give me the image. Basically, what I want is it to check if ALL or ONLY SOME are checked. If all are checked i want one image, and if only some, I want a different one.
  I hope this isn't too confusing, and I appreciate any help :)</p>
  
  <p>P.S.:Here is the question where I got the code: <a href="https://stackoverflow.com/questions/11161956/javascript-checkbox-form-validation">Original Question</a></p>