title: How to make a form not redirect immediatly if a certain string is detected, but only after submiting?
body: <p>I've created a form to put in my website and I wanted it to redirect to a URL if a certain string was submitted in that form. But now it redirects immediatly if the string is detected in the form and I only want it to redirect if that string is submitted... How can I solve this problem? Here is the code I've made:</p>
  
  <pre><code>&lt;form method="POST" id="myform"&gt;
    &lt;textarea name="inputBox123" id="myTextarea" oninput="myFunction(this)"&gt;
    &lt;/textarea&gt;
    &lt;input type="submit" value="Submeter"/&gt;
  &lt;/form&gt;
  
  &lt;script type="text/javascript"&gt;
    function myFunction(val) {
      var testThis = document.getElementById("myTextarea").value;
      if ( testThis.indexOf("launch") &gt; -1 ) {
        window.location = 'http://www.cateto.weebly.com/benoit.html';
        return false;
      }
    }
  &lt;/script&gt;
  </code></pre>