title: Form Validation - Email/telephone number
body: <p>I have a problem with a validate function, I made it in one function only and I want to add validation of email such as @ and numbers 1-9. How do I add it?</p>
  
  <p>html:</p>
  
  <pre><code>&lt;form onsubmit="return validate();" name="formValidation"&gt;
      &lt;label&gt;First Name:&lt;/label&gt;
      &lt;input type="text" name="firstName" /&gt;&lt;br /&gt;&lt;br /&gt;
      &lt;label&gt;Last Name:&lt;/label&gt;
      &lt;input type="text" name="lastName" /&gt;&lt;br /&gt;&lt;br /&gt;
      &lt;label&gt;E_mail:&lt;/label&gt;
      &lt;input type="text" name="Email" /&gt;&lt;br /&gt;&lt;br /&gt;
      &lt;label&gt;Confirm E_mail:&lt;/label&gt;
      &lt;input type="text" name="confirmEmail" /&gt;&lt;br /&gt;&lt;br /&gt;
      &lt;label&gt;Address:&lt;/label&gt;
      &lt;input type="text" name="Address" /&gt;&lt;br /&gt;&lt;br /&gt;
      &lt;label&gt;Telephone nr:&lt;/label&gt;
      &lt;input type="text" name="telephoneNr" /&gt;&lt;br /&gt;&lt;br /&gt;
      &lt;br /&gt;
      &lt;p&gt;submit your form: &lt;/p&gt;&lt;input type="submit" value="Submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>js:</p>
  
  <pre><code>function validate(){
      if(document.formValidation.firstName.value == "" ||
      document.formValidation.lastName.value == "" ||
      document.formValidation.Email.value == "" ||
      document.formValidation.confirmEmail.value == "" ||
      document.formValidation.Address.value == "" ||
      document.formValidation.telephoneNr.value == "")
      {
          alert("Please fill all the boxes before submitting!");
          return false;
      } else {
          alert('Your form has been submitted!');
      }
  
  }
  </code></pre>