From fce19045ac1a2afd92080d4784117916515faaee Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 18 Mar 2015 17:21:42 +0100 Subject: [PATCH] Bug 9120: Prevent form submission on adding tags - OPAC At the OPAC, if the user adds tags pressing 'Enter', the page is reloaded and the tags are not added. To prevent that, this patch suggests to block the "press enter" event on the inputs. Test plan: 0/ Confirm the bad behavior, without this patch. 1/ Apply this patch and confirm nothing happen on pressing enter when the focus is on the add tag input (At the opac, on the result view). Patch works as expected. Signed-off-by: Marc Veron Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 7fa67b2f83f418df0923caaeec444b6a8f728b21) Signed-off-by: Chris Cormack --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt index a4dc8395d9..f38a3e9113 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -486,7 +486,7 @@ Add tag @@ -919,6 +919,10 @@ $(document).ready(function(){ }); [% END %] +$("input.newtag").on('keydown', function(e){ + if (e.keyCode == 13) { e.preventDefault(); } +}); + }); //]]> -- 2.39.5