title: go to another page html with javascript
body: <p>I have two files. One is <code>login.html</code> which is a simple html5 file with a form.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;form method="post" action="" name="form1"&gt;entre the pasword:
      &lt;input type="password" name="code" placeholder="code" maxlength="6"&gt;
      &lt;p class="submit"&gt;
          &lt;input type="submit" name="commit" value="send" onclick="verif(document.form1.code)"&gt;
      &lt;/p&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Second is my javascript file with the below code:</p>
  
  <pre><code>function verif(inputtxt) {
  
      var pwd = "123456";
      if (inputtxt.value.match(pwd)) {
          window.location.href = 'Test.html';
      } else {
          alert('Code erron\351 ! ')
          return false;
      }
  
  }
  </code></pre>
  
  <p>Now my problem is that when I enter my password, if it is <strong>wrong</strong> the alert message indicating an error should appear (it appears and I don't have a problem with that) and if it is <strong>correct</strong>, I should get redirected to the next page. The second part doesn't work for me.</p>
  
  <p>Please help, I'm stuck with that for two days now..</p>