From 1945a59a72a65b0da0576c95754abf4e8ab0c2ce Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Thu, 1 Feb 2024 10:33:03 +0100 Subject: [PATCH] UI - Show error/warning when trying to compare the same version --- changedetectionio/static/js/diff-overview.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/changedetectionio/static/js/diff-overview.js b/changedetectionio/static/js/diff-overview.js index 8cbe7dcd..767cf6e1 100644 --- a/changedetectionio/static/js/diff-overview.js +++ b/changedetectionio/static/js/diff-overview.js @@ -90,5 +90,10 @@ $(document).ready(function () { } } - + $('#diff-form').on('submit', function (e) { + if ($('select[name=from_version]').val() === $('select[name=to_version]').val()) { + e.preventDefault(); + alert('Error - You are trying to compare the same version.'); + } + }); });