title: Form validation regular expressions using javascript
body: <p>Hello How can i add regular expressions in to my form validation i have done really basic form validation below and would just like to add regular expressions to increae security any ideas?? Noob at js</p>
  
  <pre><code>    &lt;head&gt;
      &lt;script&gt;
      function validateForm() {
      var x = document.forms["login"]["username"].value;
      if (x == "") {
      alert("Name must be filled out");
      return false;
      }
      var x = document.forms["login"]["password"].value;
      if (x == "") {
      alert("Password must be filled out");
      return false;
      }
      }
      &lt;/script&gt;
      &lt;/head&gt;
  </code></pre>