Skip to content

Commit

Permalink
Merge pull request #6272 from akatsoulas/disable-update
Browse files Browse the repository at this point in the history
Disable update button if no value is set
  • Loading branch information
akatsoulas authored Oct 2, 2024
2 parents 1529f4b + 8caa6c3 commit 417b304
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 417b304

Please sign in to comment.