X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=js%2Fcrm.ajax.js;h=3ea776c4f834190e1cd261bae28f1c509a8a3f9b;hb=00252851362ea1d1373ac5075624c89359b9427c;hp=ce4c115492d61f8be72bc138d6d6ea65cb0bb17a;hpb=21d8b8e9a7b04aba56b1c511929081cb83056067;p=civicrm-core.git diff --git a/js/crm.ajax.js b/js/crm.ajax.js index ce4c115492..3ea776c4f8 100644 --- a/js/crm.ajax.js +++ b/js/crm.ajax.js @@ -272,6 +272,14 @@ that._handleOrderLinks(); that.element.trigger('crmLoad', data); if (that.options.crmForm) that.element.trigger('crmFormLoad', data); + // This is only needed by forms that load via ajax but submit without ajax, e.g. configure contribution page tabs + // TODO: remove this when those forms have been converted to use ajax submit + if (data.status === 'form_error' && $.isPlainObject(data.errors)) { + that.element.trigger('crmFormError', data); + $.each(data.errors, function(formElement, msg) { + $('[name="'+formElement+'"]', that.element).crmError(msg); + }); + } }).fail(function(data, msg, status) { that._onFailure(data, status); });