From c0d9f89c4fd078131a12c7ab3836db28f45a5629 Mon Sep 17 00:00:00 2001 From: rishi2019194 <58341663+rishi2019194@users.noreply.github.com> Date: Sun, 15 Oct 2023 18:25:35 -0400 Subject: [PATCH] Added error message when feedback requested without selecting any movie --- src/recommenderapp/static/script.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/recommenderapp/static/script.js b/src/recommenderapp/static/script.js index c20e5c9d4..9c24a404f 100644 --- a/src/recommenderapp/static/script.js +++ b/src/recommenderapp/static/script.js @@ -116,6 +116,12 @@ $(document).ready(function () { 2: "Yet to watch", 3: "Like", }; + + // to check if any movies selected before giving feedback + if(myForm.length == 0){ + alert("No movies found. Please add movies to provide feedback."); + return; + } var error = false; // Flag to track errors for (var i = 0; i < myForm.length; i++) {