diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt index 040a9c0c32..528c7bd326 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt @@ -367,7 +367,7 @@ [% END %] $(document).ready(function() { [% IF borrowers %] - KohaTable("borrowerst", { + let patron_table = KohaTable("borrowerst", { "order": [[ 1, "asc" ]], "autoWidth": false, }, table_settings); @@ -418,6 +418,23 @@ e.preventDefault(); del_attributes(this); }); + + $('form[name="f"]').on("submit", function(){ + // Add the checkboxes to the DOM before we submit the form + var form = this; + var checkboxes = patron_table.$('input:checkbox:checked').serializeArray(); + $.each(checkboxes, function(){ + let borrowernumber = this.value; + if(!$(form).find('input[name="borrowernumber"][value="'+borrowernumber+'"]').length){ + $(form).append( + $('') + .attr('type', 'hidden') + .attr('name', 'borrowernumber') + .val(borrowernumber) + ); + } + }); + }); }); function updateAttrValues (select_attr) {