huge updates
This commit is contained in:
1 parent
861d64c95a
commit
ee89d38489
56 files changed
+10130
-4185
No files matched your search
@@ -0,0 +1,25 @@
|
||||
// Setup feedback form validation
|
||||
function setupRatingFormValidation() {
|
||||
const ratingForm = document.querySelector(".feedback-form");
|
||||
const ratingInput = document.getElementById("selected_rating");
|
||||
const ratingError = document.getElementById("rating-error");
|
||||
|
||||
if (ratingForm && ratingInput && ratingError) {
|
||||
// Add form validation before submission
|
||||
ratingForm.addEventListener("submit", function(e) {
|
||||
// Check if rating is selected
|
||||
if (!ratingInput.value) {
|
||||
e.preventDefault(); // Stop form submission
|
||||
if (ratingError) {
|
||||
ratingError.style.display = "block";
|
||||
ratingError.scrollIntoView({ behavior: "smooth" });
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Make function globally accessible
|
||||
window.setupRatingFormValidation = setupRatingFormValidation;
|
||||
Reference in new issue
Block a user