title: Trigger a button on the Enter work only in fulse password
body: <p>I dont have much knowledge of HTML but I am trying to create a code that a person enters a password - if the password is correct the site will transfer to another site and if the password is incorrect an error message will pop up.
  Very important - my goal is that they can use it without a computer mouse so it is important to me that the page works by pressing Enter.
  I was able to create a code that actually works and when you press enter in the password field it does pop up a message that the code is incorrect (if indeed it is incorrect)</p>
  <p>My problem - that when the code is correct and anter is pressed - that when the code is correct and I press enter I do not move to the next page - it only moves at the click of a button.
  I mean that pressing Enter in the password field only works if the code is incorrect and does not perform the said operation when the code is correct.</p>
  <p>Why? How do I fix the problem?</p>
  <pre><code>       &lt;form id=&quot;login_form&quot; autocomplete=&quot;off&quot; class=&quot;form_class&quot; method=&quot;post&quot;&gt;
        &lt;span&gt;&lt;h2 style=&quot;text-align:center;&quot;&gt;יש להקליד סיסמא באותיות קטנות ומספרים בלבד&lt;/h2&gt;&lt;/span&gt;   
        &lt;form name=&quot;login&quot;&gt;
          &lt;input type=&quot;text&quot;
          id=&quot;txtSearch&quot;
          onkeydown = &quot;if (event.keyCode == 13)
          document.getElementById('btnSearch').click()&quot;
          style=&quot;text-align:center;&quot;
          name=&quot;password&quot;
          placeholder=&quot;הקלד סיסמא&quot;
          /&gt;
          &lt;button type=&quot;button&quot;
          id=&quot;btnSearch&quot;
          onclick=&quot;check(this.form)&quot;
          value=&quot;Login&quot;&gt;אישור
          &lt;/button&gt;
        &lt;/form&gt;   
        &lt;script language=&quot;javascript&quot;&gt; 
        function check(form) {
        if(form.password.value == &quot;omg911&quot;) { window.open(&quot;**&quot;,&quot;_self&quot;)
  }
        else { alert(&quot;קוד שגוי, נסה שנית&quot;) } } 
        &lt;/script&gt;
  </code></pre>