title: Hide form once validation is true
body: <p>I need to be able to hide my form, once all the validation is correct</p>
  
  <pre><code>   window.addEventListener('load', init)
  
  function init(e)
  {
  
      var firstName = document.querySelector('#first-name');
      var lastName = document.querySelector('#last-name');
      var email = document.querySelector('#email');
      var emailConfirm = document.querySelector('#email-confirm');
      var phoneNumber = document.querySelector('#phone');
      var submit = document.querySelector('#submit');
      var input = document.querySelectorAll('input');
      var span = document.querySelectorAll('span');
      var label = document.querySelectorAll('label');
      var fields = document.querySelectorAll("#form input[type=text]");
      var form = document.querySelector('#form');
  
  
      submit.addEventListener('click', Edit);
      submit.addEventListener('click', Results);
  
      function Edit(e)
      {
          for (let i = 0; i &lt; fields.length; i++)
          {
              if (fields[i].value=="")
              {
                  span[i].innerHTML = "*";
                  span[i].style.color = "red"
                  label[i].style.color = "red";
              }
              else
              {
                  span[i].innerHTML="";
                  label[i].style.color = "black";
              }
          }
  
          if (email.value !== emailConfirm.value)
              {
                  span[2].innerHTML = "Emails do not match";
                  span[3].innerHTML = "Emails do not match"
              }
              else
              {
                  span[2].innerHTML = "";
                  span[3].innerHTML = "";
              }
      }
  </code></pre>
  
  <p>So once all field are filled in and once the email and email confirmation match i need the form to hide once submit is clicked, and then display a conformation page</p>