From 6d172c93a8deaccb0b5d1449cd3b7dc6fc9e8626 Mon Sep 17 00:00:00 2001 From: Bernhard Leers Date: Thu, 18 Aug 2016 21:37:36 +0200 Subject: [PATCH] fix for #6224: iterate over all agreement checkboxes in all payment methods to place error label --- .../view/frontend/web/js/model/agreement-validator.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/agreement-validator.js b/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/agreement-validator.js index 3d030a62eb425..f32a6cefa0668 100644 --- a/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/agreement-validator.js +++ b/app/code/Magento/CheckoutAgreements/view/frontend/web/js/model/agreement-validator.js @@ -36,11 +36,9 @@ define( errorElement: 'div', meta: 'validate', errorPlacement: function (error, element) { - var errorPlacement = element; - if (element.is(':checkbox') || element.is(':radio')) { - errorPlacement = element.siblings('label').last(); - } - errorPlacement.after(error); + $("input[name='"+element.attr('name')+"'").each(function() { + $(this).next('label').after(error.clone()); + }); } }).element(agreementsInputPath); }