title: How to trigger my input type=button with enter?
body: <p>I'm using this form I found :</p>
  
  <pre><code>&lt;FORM METHOD="POST" ENCTYPE="x-www-form-urlencoded"&gt;
      &lt;input type="text" id="Password"/&gt;
      &lt;input type="button" id="Access" onclick="document.location=Password.value" VALUE="Accès"/&gt;
  &lt;/FORM&gt;
  </code></pre>
  
  <p>It works fine for what I want to do, but I would like to allow the command to be triggered by pressing enter too. I have read a solution using the <code>submit</code> type instead and also a solution adding</p>
  
  <p><code>onkeydown="if (event.keyCode == 13) document.getElementById('Access').click()"</code> in the text input.</p>
  
  <p>Neither works so I don't know if I'm misusing them or if my <code>document.location=Password.value</code> cannot be used this way. If so, could you indicate me the simplest solution to replace it without using php or js file because I don't really understand that. This website will not be public so I don't really care about security or if it's not the right way to do.</p>
  
  <p>EDIT : Considering the answer you gave me are not fully working (jlbruno's one does not work neither on enter or on click, riad's one only works on click), here is the full code of my page with riad's solution, please tell me if something could interfere</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>    &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
      &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr"&gt;
   &lt;head&gt;
    &lt;title&gt;JVPW Cloud - Le Nuage de la JVPW !&lt;/title&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
    &lt;link rel="stylesheet" media="screen" type="text/css" title="Design" href="design.css" /&gt;
    &lt;link rel="shortcut icon" type="image/x-icon" href="favicon.ico" /&gt;
   &lt;/head&gt;
   &lt;body&gt;
      &lt;p&gt;&lt;center&gt;&lt;img src="logo.png" width="1000" height="400" /&gt;&lt;/center&gt;&lt;/p&gt;
      &lt;p&gt;&lt;span style="font-family:Verdana"&gt;&lt;b&gt;Tout l'univers de la JVPW pour seulement 9.99 $&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;
  
      &lt;h1&gt;Bienvenue&lt;/h1&gt;
      &lt;p&gt;Si vous disposez d'un early access gratuit, entrez le code ci-dessous et appuyez sur Accès (pas Entrée !)&lt;/p&gt;
  
      &lt;FORM METHOD="POST" ENCTYPE="x-www-form-urlencoded"&gt;
      &lt;input type="text" id="Password" onkeydown="if (event.keyCode == 13) document.getElementById('Access').click()" /&gt;
      &lt;input type="button" id="Access" onclick="window.location=document.getElementById('Password').value ;" VALUE="Accès"/&gt;
      &lt;/FORM&gt;
      &lt;/body&gt;
      &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>