# Press enter to login

**URL:** <https://www.ruby-forum.com/t/press-enter-to-login/151219>\
**Category:** Rails\
**Created:** [October 18, 2008, 11:09am UTC](https://www.ruby-forum.com/t/press-enter-to-login/151219 "2008-10-18T11:09:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Applejus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e5b9ba/32.png) [@Applejus](https://www.ruby-forum.com/u/Applejus)\
**Post date:** [October 18, 2008, 11:09am UTC](https://www.ruby-forum.com/t/press-enter-to-login/151219/1 "2008-10-18T11:09:41Z")

</div>

Hi there,

I have a login form and would like to know if there’s a way to let the  
user  
press enter to submit the login information as an alternative to  
clicking  
the login button.

## Thanks!

View this message in context:  
[http://www.nabble.com/press-enter-to-login-tp20045312p20045312.html](http://www.nabble.com/press-enter-to-login-tp20045312p20045312.html)  
Sent from the RubyOnRails Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![Applejus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e5b9ba/32.png) [@Applejus](https://www.ruby-forum.com/u/Applejus)\
**Post date:** [October 18, 2008, 9:11pm UTC](https://www.ruby-forum.com/t/press-enter-to-login/151219/2 "2008-10-18T21:11:13Z")

</div>

Applejus wrote:

> Hi there,
> 
> I have a login form and would like to know if there’s a way to let the  
> user  
> press enter to submit the login information as an alternative to  
> clicking  
> the login button.

This is really a JavaScript question…

[http://www.htmlcodetutorial.com/forms/index\_famsupp\_157.html](http://www.htmlcodetutorial.com/forms/index_famsupp_157.html)

Or more results from google:  
[http://www.google.com/search?hl=en&safe=off&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=3KH&q=javascript+submit+form+on+enter&btnG=Search](http://www.google.com/search?hl=en&safe=off&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=3KH&q=javascript+submit+form+on+enter&btnG=Search)

HTH,  
Michael G.
