title: setTimeout() on javascript for custom URL based on form submit
body: <p>How to fix? I've been struggling with this all day - looking at other posts and trying different methods. Any help is much appreciated... ~ newbie </p>
  
  <p>The setTimeout() on this line of javascript breaks the code - causing a null value that is passed on for the custom URL.</p>
  
  <p>The plan is </p>
  
  <ol>
  <li>The user types a value in the text field. </li>
  <li>The value is displayed on the webpage. </li>
  <li>After a 4 second pause the user is automatically redirected to a new webpage based on the value they typed into the text field... this value being passed into the URL from submitting the form. </li>
  </ol>
  
  <p>... Stuck at #3. The page pauses for 4 seconds, but no value is passed to the URL and it redirects to the home directory.</p>
  
  <p>the code in question:</p>
  
  <pre><code>&lt;form id="type_form" action="html-echo.php" method="post" onsubmit="setTimeout(function() { location.href='http://localhost:8888/vanity/site/' + document.getElementById('nav').value; return false; }, 4000);"&gt;
        &lt;input id="nav" maxlength="10" type="text" name="nav" autofocus placeholder="TYPE YOUR CHOICE... (spelling counts)"&gt;
  
          &lt;script&gt;
            if (!("autofocus" in document.createElement("input"))) {
              document.getElementById("nav").focus();
            }
          &lt;/script&gt;
        &lt;button class="send" type="submit"&gt;SEND&lt;/button&gt;&lt;/form&gt;
  </code></pre>
  
  <p>Thank you!</p>