title: Basic Javascript validation
body: <p>This is a really simple problem. I had this working and then i must of changed something and now it doesn't work. Its just a peice of JS code checking for an empty string. Here is the code below. It's been driving me mad for 20 minutes trying to figure out what is wrong with this ridicliously simple code.</p>
  
  <pre><code> &lt;script  type="text/javascript"&gt;
   function validateForm(){
   var email= document.getElementById('email').value;
   if (email.length==''){
   alert("please fill out email");}}
      &lt;/script&gt;
  
  &lt;form name="contact" method="post" action='ContactPHP.php'&gt;
  Your Email: &lt;input name='email' type='text' /&gt;&lt;br /&gt;
  &lt;input type="button" value="submit" onClick="validateForm()"/&gt;
   &lt;/form&gt;
  </code></pre>