From 994cdfb2340c977a8d978bc483269f70660380b3 Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Sun, 22 Jan 2017 22:06:28 +0100 Subject: [PATCH] Allow tabbing via space in log form --- templates/contest/log.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/templates/contest/log.html b/templates/contest/log.html index 78b5080..997ccfc 100644 --- a/templates/contest/log.html +++ b/templates/contest/log.html @@ -117,6 +117,19 @@ $(document).ready(function() { $("#id_call").on("input", checkForDupes); $("#id_band").change(checkForDupes); + + // use space to get to the next field for certain fields + function mvFocusOnSpace(e, newFocusId) { + if(e.keyCode == 32) { + $(newFocusId).focus() + return false; + } + } + + $("#id_call").on("keydown", function(e) { return mvFocusOnSpace(e, "#id_otherNo"); }); + $("#id_otherNo").on("keydown", function(e) { return mvFocusOnSpace(e, "#id_refStr"); }); + $("#id_refStr").on("keydown", function(e) { return mvFocusOnSpace(e, "#submit-id-submit"); }); + });