summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--static/script.js7
-rw-r--r--templates/p.html2
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">