skip to Main Content

Form won’t submit when pressing enter? It should work because other forums suggest that it should work without any config? Don’t want to add any extra javascript.
I’m on bootstrap

I tested for syntax errors and other stack overflow question’s but none solved my problem

<h1>Signup</h1>
<form method="post" action="/signup">
  <label for="username">username:</label>
  <input type="text" name="username" /><br />
  <label for="password">password:</label>
  <input type="password" name="password" /><br />
  <input type="submit" />
</form>
<br>
<h1>Login</h1>
<form method="post" action="/login">
  <label for="username">username:</label>
  <input type="text" name="username" /><br />
  <label for="password">password:</label>
  <input type="password" name="password" /><br />
  <input type="submit" />
</form>

2

Answers


  1. <h1>Signup</h1>
    <form method="post" action="/signup">
      <label for="username">username:</label>
      <input type="text" name="username" /><br />
      <label for="password">password:</label>
      <input type="password" name="password" /><br />
      <button type="submit">submit</button>
    </form>
    <br>
    <h1>Login</h1>
    <form method="post" action="/login">
      <label for="username">username:</label>
      <input type="text" name="username" /><br />
      <label for="password">password:</label>
      <input type="password" name="password" /><br />
     <button type="submit">submit</button>
    </form>
    Login or Signup to reply.
  2. You need to be inside an input field of the form then press enter to submit

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search