Autofocus the username field on user creation
authorSebastian Spaeth <Sebastian@SSpaeth.de>
Mon, 26 Nov 2012 20:38:29 +0000 (21:38 +0100)
committerSebastian Spaeth <Sebastian@SSpaeth.de>
Mon, 26 Nov 2012 20:38:29 +0000 (21:38 +0100)
On a page with the single purpose to enter new user data, we should
auto-focus the username field. It is very annoying to have to click in
that field before starting to type. Theoretically, there is the "autofocus"
attribute in html5, but IE does not support that.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
mediagoblin/templates/mediagoblin/auth/register.html

index a2505cb9d71c137392ea5a7633b3612c98d6b97f..6dff0207a78bfc70909002b2e66a2b12dc7fc105 100644 (file)
@@ -42,4 +42,6 @@
       </div>
     </div>
   </form>
+<!-- Focus the username field by default -->
+<script>$(document).ready(function(){$("#username").focus();});</script>
 {% endblock %}