From f527be0af00f1b2188f6175886cbb51ff52b6b27 Mon Sep 17 00:00:00 2001 From: DJ3CE Date: Sat, 23 Mar 2024 17:33:32 +0100 Subject: [PATCH] Prevent non-numeric entries in contesting-serial fields --- assets/js/sections/contesting.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/js/sections/contesting.js b/assets/js/sections/contesting.js index 1ce2b5eb..399b4160 100644 --- a/assets/js/sections/contesting.js +++ b/assets/js/sections/contesting.js @@ -94,10 +94,10 @@ $(function () { }); }); -// We don't want spaces to be written in serial +// We don't want anything but numbers to be written in serial $(function () { - $('#exch_serial_r').on('keypress', function (e) { - if (e.which == 32) { + $('#exch_serial_r, #exch_serial_s').on('keypress', function (e) { + if (e.key.charCodeAt(0) < 48 || e.key.charCodeAt(0) > 57) { return false; } });