diff options
author | raylu <raylu@mixpanel.com> | 2011-08-21 02:50:09 -0700 |
---|---|---|
committer | raylu <raylu@mixpanel.com> | 2011-08-21 02:50:09 -0700 |
commit | 569d9165efbd1aeef7238ae4166160865f75377c (patch) | |
tree | 0583c58d798042713af56ba70dab78c1e6193582 | |
parent | 820edebc26f2254bfb78e779a79af70dac2b84d8 (diff) | |
download | audioaxis-569d9165efbd1aeef7238ae4166160865f75377c.tar.xz |
don't search when enter is hit on username field
-rw-r--r-- | static/script.js | 7 | ||||
-rw-r--r-- | templates/p.html | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/static/script.js b/static/script.js index ed5e2f9..4274c9c 100644 --- a/static/script.js +++ b/static/script.js @@ -213,6 +213,13 @@ function search(query) { return false; } +function userKeyPress(e) { + if (e.keyCode == 13) {// enter + $('#song').focus(); + return false; + } +} + function add(id, title) { params = { pid: pid, diff --git a/templates/p.html b/templates/p.html index 76e1dfd..8811e0a 100644 --- a/templates/p.html +++ b/templates/p.html @@ -5,7 +5,7 @@ <img src="/static/audioaxis-white.png" alt="Audio Axis" class="aa"> <form onsubmit="return search(this.song.value)"> <label for="user">Username:</label> - <input type="text" id="user" value="anonymous" size="16"> + <input type="text" id="user" value="anonymous" size="16" onkeypress="return userKeyPress(event)"> <br> <label for="song">Add a song:</label> <input type="text" id="song" autocomplete="off"> |