title: JavaScript Help! Stop Alert Box from resetting form
body: <p>I am trying to stop the javascript from clearing the form text input by the user. Here is my function. It is set to loop until it exits, and works like I need it too. Now I need it not delete the data in the text boxes as I need it to run a second function from a different button.</p>
  
  <pre><code>function formValidate () {
      var validateName = document.getElementById("name").value;
      var validateAge = document.getElementById("age").value;
      var validateEmail = document.getElementById("email").value;
      var validateWeight = document.getElementById("weight").value;
      var validateHeight = document.getElementById("height").value;
  
      var x=document.forms["form3"]["email"].value;
      var atpos = x.indexOf("@");
      var dotpos = x.lastIndexOf(".");
  
      if (validateName == null || validateName=="")
      {
      alert("First name must be filled out." + '\n' + "Please fill out again.");
      return false;
      }
      else if (isNaN(validateAge) || validateAge==null || validateAge=="")
      {
      alert("Age must be filled out and/or be numeric." + '\n' + "Please fill out again.");
      return false;
      }
  
      else if (atpos&lt;1 || dotpos&lt;atpos+2 || dotpos+2&gt;=x.length)
      {
      alert("Email must be in a valid email address format." + '\n' + "Please fill out again.");
      return false;
      }
      else if (isNaN(validateWeight) || validateWeight==null || validateWeight=="")
      {
      alert("Weight must be filled out and/or be numeric." + '\n' + "Please fill out again.");
      return false;
      }
      else if (isNaN(validateHeight) || validateHeight==null || validateHeight=="")
      {
      alert("Height must be filled out and/or be numeric" + '\n' + "Please fill out again.");
      return false;
      }
  }
  </code></pre>