Skip to content

Commit

Permalink
Disable update button if no value is set
Browse files Browse the repository at this point in the history
  • Loading branch information
akatsoulas committed Oct 2, 2024
1 parent 1befd9f commit 8caa6c3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kitsune/sumo/static/sumo/js/flagit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down

0 comments on commit 8caa6c3

Please sign in to comment.