diff --git a/localization/strings.pot b/localization/strings.pot index e1d4938d..4b17ab64 100644 --- a/localization/strings.pot +++ b/localization/strings.pot @@ -2040,7 +2040,7 @@ msgstr "" msgid "After merging, this product will be kept" msgstr "" -msgid "After merging, all occurences of this product will be replaced by \"Product to keep\" (means this product will not exist anymore)" +msgid "After merging, all occurences of this product will be replaced by the kept product (means this product will not exist anymore)" msgstr "" msgid "Merge" diff --git a/public/viewjs/chores.js b/public/viewjs/chores.js index 37a4958d..6c2f789d 100644 --- a/public/viewjs/chores.js +++ b/public/viewjs/chores.js @@ -88,8 +88,15 @@ $(".merge-chores-button").on("click", function(e) $("#merge-chores-modal").modal("show"); }); -$("#merge-chores-save-button").on("click", function() +$("#merge-chores-save-button").on("click", function(e) { + e.preventDefault(); + + if (!Grocy.FrontendHelpers.ValidateForm("merge-chores-form", true)) + { + return; + } + var choreIdToKeep = $("#merge-chores-keep").val(); var choreIdToRemove = $("#merge-chores-remove").val(); diff --git a/public/viewjs/products.js b/public/viewjs/products.js index 894e858b..3810d122 100644 --- a/public/viewjs/products.js +++ b/public/viewjs/products.js @@ -137,8 +137,15 @@ $(".merge-products-button").on("click", function(e) $("#merge-products-modal").modal("show"); }); -$("#merge-products-save-button").on("click", function() +$("#merge-products-save-button").on("click", function(e) { + e.preventDefault(); + + if (!Grocy.FrontendHelpers.ValidateForm("merge-products-form", true)) + { + return; + } + var productIdToKeep = $("#merge-products-keep").val(); var productIdToRemove = $("#merge-products-remove").val(); diff --git a/views/chores.blade.php b/views/chores.blade.php index b0ace94b..cb369ec6 100644 --- a/views/chores.blade.php +++ b/views/chores.blade.php @@ -163,34 +163,41 @@