Submitting a form by hitting return when the submit button is hidden; works in Firefox, does nothing in Chrome

I have a form with some input fields and a hidden submit button (hidden via style=”display:none”).

When you hit the return key when an input field is focused in Firefox, the form submits.

However in Chrome, when you hit return, nothing happens. I was wondering, how do you add this functionality back to Chrome?

Here’s the form, take a look at it in Chrome:

<form method="post"  action="/xxxx" accept-charset="UTF-8">

    <input type="hidden" value="SSjovFqEfRwz2vYDIsB6JRdtLAuXGmnT+tkyZnrtqEE=" name="authenticity_token">

    <div class="input text_field">
    <input type="text" size="30" name="user_session[email]" />

  <div class="input text_field">
    <input type="password" size="30" name="user_session[password]" />

    <input type="submit" value="Sign In" style="display: none;" >



I have literally no idea why it’s not working in Chrome. I think it’s a bug.

However, it is somehow to do with that display: none.

I found a nasty, horrible (!!) workaround:

input[type="submit"] {
    position: absolute;
    top: -1000px

Don’t hide it: instead, position it off the screen.

Live Demo – works in Chrome.