From bc92f0b830fa11166225b5170e598dee21ba45ca Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 13 Aug 2019 15:54:30 +0000 Subject: [PATCH] Bug 17057: (follow-up) Replace onsubmit attributes This patch removes the "onsubmit" attribute from the place hold form. To test, apply the patch and test placing a hold: Begin the process of placing a hold on a single title. On the place hold screen, uncheck the "Hold next available item" checkbox and click the "Place hold" button. You should be get an alert saying "Please select an item to place a hold." Select an item and click the "Place hold" button again. The hold should be placed. This patch affects the form validation for placing multiple holds, but I don't think the JavaScript ever has a chance to run: The template blocks the user from placing multiple holds if one of the titles has no items. Signed-off-by: Maryse Simard Signed-off-by: Katrin Fischer --- .../intranet-tmpl/prog/en/modules/reserve/request.tt | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index 1c10c2f94d..96fc32d7a4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -167,11 +167,7 @@
Hold details - [% UNLESS ( multi_hold ) %] -
- [% ELSE %] - - [% END %] + @@ -747,6 +743,16 @@ "margin-right":"0em" }); + [% UNLESS ( multi_hold ) %] + $("#hold-request-form").on("submit", function(){ + return check(); + }); + [% ELSE %] + $("#hold-request-form").on("submit", function(){ + return checkMultiHold(); + }); + [% END %] + }); function check() { -- 2.11.0