title: Why isn't this Javascript email validation only validating first if statement?
body: <p>So, I'm working on a page with a contact form, and I want to have it check if field's are empty.  I'm using this simple code below, but it only works for the first if.  It only displays "I want to know who you are" when I click submit.  It just doesn't even see the other if statements!</p>
  
  <pre><code>function validation() {
  
  var name = document.getElementById("name").value;
  var email = document.getElementById("email").value;
  var subject = document.getElementById("subject").value;
  var message = document.getElementById("message").value;
  
  if(name == null || name == "") {
  document.getElementById("name-error").innerHTML = "I want to know who you are!";
  return false;
  }
  
  if(email == null || email == "") {
  document.getElementById("email-error").innerHTML = "Give me your email!";
  return false;
  } 
  
  if(subject == null || subject == "") {
  document.getElementById("subject-error").innerHTML = "I need a subject!";
  return false;
  }
  
  if(message == null || message == "") {
  document.getElementById("message-error").innerHTML = "Don't forget your message!";
  return false;
  }
  
  }
  </code></pre>
  
  <p>And this is the HTML:</p>
  
  <pre><code>                &lt;form name="contact" id="contact" action="./assets/send.php" method="post" id="form"&gt;
  
                  &lt;label&gt;Full name&lt;/label&gt;
                  &lt;input type="text" name="name" id="name"&gt;&lt;span id="name-error"&gt;&lt;/span&gt;
                  &lt;label&gt;Email&lt;/label&gt;
                  &lt;input type="text" name="email" id="email"&gt;&lt;span id="email-error"&gt;&lt;/span&gt;
                  &lt;label&gt;Subject&lt;/label&gt;
                  &lt;input type="text" name="subject" id="subject"&gt;&lt;span id="subject-error"&gt;&lt;/span&gt;
                  &lt;label&gt;Message&lt;/label&gt;
                  &lt;textarea name="message" id="message"&gt;&lt;/textarea&gt;&lt;span id="message-error"&gt;&lt;/span&gt;
                  &lt;button onclick="return validation()" type="submit" name="send" id="send"&gt;Send&lt;/button&gt;
  
              &lt;/form&gt;
  </code></pre>