title: How do I make Enter affect a specific submit button when I have more than one?
body: <p>I have a question about having two submit buttons on a single form (the two buttons are below). I currently have two buttons, one to submit the login data and attempt to validate the login by running a database query, and the other to bring the user to a page to generate a random string and set it as their new password. </p>
  
  <p>I want to be able to make it so that when I hit enter, the second button (the login process button) is triggered, where it is currently the initial button that is done. I have tried turning the first button from an input to a normal button tag, but the issue still persists. Brief snippet of the buttons below, if the full form would be helpful I can edit it in.</p>
  
  <p>I tried some solutions I found online such as <a href="https://stackoverflow.com/questions/155188/trigger-a-button-click-with-javascript-on-the-enter-key-in-a-text-box">this</a>, but I couldn't get it working - maybe I'm just a bit stupid! </p>
  
  <p>Any and all help is fully appreciated. Thanks in advance.</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div class="column"&gt;
    &lt;div class="field"&gt;
      &lt;p class="control"&gt;
        &lt;!-- if clicked, brings user to reset password--&gt;
        &lt;input type='submit' class="button is-danger" id='loginRequest' value="Forgot Password" formaction="resetpassword.php"&gt;
      &lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="column"&gt;
    &lt;div class="field"&gt;
      &lt;p class="control"&gt;
        &lt;!-- if clicked, posts info and attempts to validate login through database--&gt;
        &lt;input type='submit' class="button is-primary" id='loginRequest' value="Login" name="requestlogin"&gt;
      &lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>