title: email validation javascript
body: <p>is this javascript function (checkValidity) correct?</p>
  
  <pre><code>function checkTextBox(textBox)
  {
     if (!checkValidity(textBox.getValue()))
         displayError("Error title", "Error message", textBox);
         textBox.focus();
  }
  
  function checkValidity(e) 
  {
      var email;
      email = "/^[^@]+@[^@]+.[a-z]{2,}$/i";
  
      if (!e.match(email)){
              return false;
      else
              return true;
      }
  }
  </code></pre>
  
  <p><strong>EDIT:</strong> All the answers appreciated! Thanks!</p>