title: Validation Always Failing To Validate
body: <p>Tried to add in some validation to a form, but it keeps acting as if the data that is being validated is invalid, even if its valid!</p>
  
  <pre><code>if (document.getElementById("mileageNumber").value  == /^[0-9]+$/)
  {
      if (document.getElementById("vehicleNumber").value  == /^[0-9]+$/)
      {
          &lt;Desired Action&gt;
      }
      else
      {
          alert("Please Enter Numbers Only");
      }
  }
  else
  {
      alert("Please Enter Numbers Only");
  }
  </code></pre>
  
  <p>Can anybody see what i have done wrong?</p>