From cd73f9c505d2b50f418df33fca2aadcc677abd55 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 22 Jul 2019 19:12:18 +1200 Subject: [PATCH] Remove the js alert message when jqueryValidation fails on frontend pages It's really really ugly & as discussed without it a) extensions can still opt to display the errors themselves and b) the inline errors still appear. Note this will have no real affect on existing code - the ugliness of this has been a blocker to getting into front end validation & at this stage only the omnipay extension is trying to work in this space. https://github.com/eileenmcnaughton/nz.co.fuzion.omnipaymultiprocessor/pull/128 I think ideally with Omnipay it DOES makes sense to display messages near the checkout button - which might be a future step --- templates/CRM/common/l10n.js.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/CRM/common/l10n.js.tpl b/templates/CRM/common/l10n.js.tpl index 89e923e150de..ee2cf1843eef 100644 --- a/templates/CRM/common/l10n.js.tpl +++ b/templates/CRM/common/l10n.js.tpl @@ -114,12 +114,12 @@ // use civicrm notifications when there are errors params.invalidHandler = function(form, validator) { + // If there is no container for display then red text will still show next to the invalid fields + // but there will be no overall message. Currently the container is only available on backoffice pages. if ($('#crm-notification-container').length) { $.each(validator.errorList, function(k, error) { $(error.element).crmError(error.message); }); - } else { - alert({/literal}"{ts escape='js'}Please review and correct the highlighted fields before continuing.{/ts}"{literal}); } };