Skip to content

Commit

Permalink
Merge pull request #998 from scientist-softserv/i948-require-banner-a…
Browse files Browse the repository at this point in the history
…lt-text

🐛 Fix banner alt text require
  • Loading branch information
kirkkwang authored Mar 13, 2024
2 parents e549e6f + 9ad083e commit c6e1db8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/views/hyrax/admin/appearances/_banner_image_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@
});

document.querySelector('.banner-submit').addEventListener('click', function(e) {
// Get all required fields
var requiredFields = document.querySelectorAll('input[required],textarea[required],select[required]');

// Check if all required fields are filled
for (var i = 0; i < requiredFields.length; i++) {
if (!requiredFields[i].value) {
// return early if not all required fields have been filled out
return;
}
}

e.preventDefault();

// Show the spinner
Expand Down

0 comments on commit c6e1db8

Please sign in to comment.