From 8a3e3b95356e67bd70f1051b47b52cd985357848 Mon Sep 17 00:00:00 2001 From: Jake Deery Date: Tue, 9 Sep 2025 11:44:11 +0000 Subject: [PATCH] Bug 40783: Fix erroneous bookbag_form submission This patch addresses a bug where pressing return when focused on the bookbag_form checkbox results in a form submission. The bookbag_form is not designed to be submitted, so the behaviour has been disabled for accessibility reasons. TO TEST: a) go to /cgi-bin/koha/opac-search.pl?idx=kw&q=history&sort_by=relevance b) add an item to your cart (ensure the syspref is enabled) c) tab through the results until you come across a checkbox, press return d) notice your page refresh, a form submission has happened APPLY PATCH e) repeat steps a-c f) notice the page no longer refreshes, and that no form submission occurs g) notice the items are still in your cart and can be interacted with normally SIGN OFF --- koha-tmpl/opac-tmpl/bootstrap/js/results-list.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/results-list.js b/koha-tmpl/opac-tmpl/bootstrap/js/results-list.js index e3b2b4b83cd..09e2b99972a 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/results-list.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/results-list.js @@ -149,6 +149,11 @@ $(document).ready(function () { } } + $("#bookbag_form").on("submit", function (e) { + e.preventDefault(); + return false; + }) + $("#addtocart").on("click", function (e) { e.preventDefault(); addMultiple(); -- 2.43.0