From: Carl Worth <cworth@cworth.org>
Date: Sat, 19 Sep 2020 21:41:45 +0000 (-0700)
Subject: Add some autofocus attributes to several forms
X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;p=lmno-server

Add some autofocus attributes to several forms

Just trying to make things a little more friendly, (so that, a page
with a single form that has a single text field loads with that field
having focus already).
---

diff --git a/templates/choose-nickname.html b/templates/choose-nickname.html
index 9817b1d..f35abb6 100644
--- a/templates/choose-nickname.html
+++ b/templates/choose-nickname.html
@@ -41,7 +41,7 @@
            {% else %}
            required
            {% endif %}
-           >
+           autofocus>
   </div>
 
   <div class="form-field large">
diff --git a/templates/empires-game.html b/templates/empires-game.html
index 3eb6338..b1d6b7a 100644
--- a/templates/empires-game.html
+++ b/templates/empires-game.html
@@ -50,7 +50,7 @@
   <form id="register-form" onsubmit="register(this); return false">
     <div class="form-field large">
       <label for="character">Character name</label>
-      <input type="text" id="character" autocomplete="off" required>
+      <input type="text" id="character" autocomplete="off" required autofocus>
     </div>
 
     <div class="form-field large">
diff --git a/templates/login.html b/templates/login.html
index 5767316..489870d 100644
--- a/templates/login.html
+++ b/templates/login.html
@@ -40,7 +40,7 @@ function lmno_login(form) {
 <form id="login-form" onsubmit="lmno_login(this); return false">
   <div class="form-field large">
     <label for="username">Username</label>
-    <input type="text" id="username" required>
+    <input type="text" id="username" required autofocus>
   </div>
 
   <div class="form-field large">