From 8caa6c365fbe78addc58b467bad81c9afdd54834 Mon Sep 17 00:00:00 2001 From: Tasos Katsoulas Date: Wed, 2 Oct 2024 13:15:50 +0300 Subject: [PATCH] Disable update button if no value is set --- kitsune/sumo/static/sumo/js/flagit.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kitsune/sumo/static/sumo/js/flagit.js b/kitsune/sumo/static/sumo/js/flagit.js index 148d868eec2..46d97c62be1 100644 --- a/kitsune/sumo/static/sumo/js/flagit.js +++ b/kitsune/sumo/static/sumo/js/flagit.js @@ -78,6 +78,11 @@ document.addEventListener('DOMContentLoaded', () => { const form = this.closest('form'); const questionId = this.getAttribute('data-question-id'); const updateButton = document.getElementById(`update-status-button-${questionId}`) || form.querySelector('input[type="submit"]'); + + if (!this.value || this.value === "") { + updateButton.disabled = true; + return; + } updateButton.disabled = false; if (this.classList.contains('topic-dropdown')) {