Skip to content

Instantly share code, notes, and snippets.

@felquis
Created December 3, 2019 15:17
Show Gist options
  • Save felquis/8cee7018702fa1d33116cd3a4a45cf66 to your computer and use it in GitHub Desktop.
Save felquis/8cee7018702fa1d33116cd3a4a45cf66 to your computer and use it in GitHub Desktop.
How to submit a form on ENTER without a submit button

If you have a form, and in the design specs there's no submit button inside the form, you can still make the form submit when the user presses enter. You just need to put a hidden input of type submit.

<form>
  <input type="text" name="anything" />
  <input type="submit" hidden />
</form>

That is it for today. Questions in the comment field bellow, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment