Prevent non-numeric input in contesting-serial fields

This commit is contained in:
Peter Goodhall 2024-04-02 13:45:00 +01:00 committed by GitHub
commit 55d24cd52b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -88,10 +88,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;
}
});