From feb866a618ad5fccb4384dbc9c8b6fd23fec6472 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 16 Oct 2018 16:55:18 -0300 Subject: [PATCH] Bug 15774: Fix JS check when AV and MARC field are both selected Signed-off-by: Jonathan Druart Signed-off-by: Josef Moravec Signed-off-by: Nick Clemens --- .../prog/en/modules/admin/additional-fields.tt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt index 1d85a8e845..3b5309cfe4 100755 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/additional-fields.tt @@ -189,11 +189,13 @@ return confirm(_("Are you sure you want to delete this field?")); }); - $("#add_field").on('submit', function(){ - if ( $("#marcfield").val().length > 0 - && $("select[name='authorised_value_category']" ).val().length > 0 ) { - alert("You cannot select an authorised value category and a marcfield"); - return false; + $("#add_field").on('submit', function() { + if ( $("#marcfield").length && $("select[name='authorised_value_category']").length ) { + if ( $("#marcfield").val().length > 0 + && $("select[name='authorised_value_category']" ).val().length > 0 ) { + alert("You cannot select an authorised value category and a marcfield"); + return false; + } } return true; }); -- 2.39.5