From 838d062eea7599f07fe11b729c874c8fa5d63609 Mon Sep 17 00:00:00 2001 From: Magnus Persson Date: Thu, 3 Feb 2022 21:48:11 +0100 Subject: [PATCH] validation on header form --- html/config.htm | 21 ++++++++++++++++----- html/config.min.htm | 2 +- test/status.json | 2 +- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/html/config.htm b/html/config.htm index 9c0d31b..aae1526 100644 --- a/html/config.htm +++ b/html/config.htm @@ -402,14 +402,14 @@ @@ -433,6 +433,16 @@ $('#modal-http').on('hide.bs.modal', function (event) { $(field1).val(modal.find('.modal-body #header1').val()) $(field2).val(modal.find('.modal-body #header2').val()) }) +function checkHeader(input) { + console.log( input.value ); + if (input.value != "" && input.value.indexOf(":") == -1) { + $("#btn-close").prop("disabled", true); + $(input).removeClass("is-valid").addClass("is-invalid"); + } else { + $("#btn-close").prop("disabled", false); + $(input).removeClass("is-invalid").addClass("is-valid"); + } +}

Temperature Format:





Gravity Format:


(C) Copyright 2021-22 Magnus Persson
\ No newline at end of file +Beer Gravity Monitor

Temperature Format:





Gravity Format:


(C) Copyright 2021-22 Magnus Persson
\ No newline at end of file diff --git a/test/status.json b/test/status.json index 6b63602..f92917e 100644 --- a/test/status.json +++ b/test/status.json @@ -3,7 +3,7 @@ "angle": 89.86, "gravity": 1.1052, "gravity-tempcorr": 1.1031, - "temp-c": 0, + "temp-c": 12, "temp-f": 32, "battery": 3.81, "temp-format": "C",