Repository URL to install this package:
|
Version:
1.2.29 ▾
|
(function ($, Drupal) {
'use strict';
// Drupal ajax command for adding a custom form inline error to a field.
Drupal.AjaxCommands.prototype.addCustomFormsError = function (ajax, response, status) {
let message = response.message;
$(response.selector).closest('.js-custom-forms-item__field').append('<div class="form-item--error-message">'+response.message+'</div>')
};
// Drupal ajax command for removing any existing inline custom form errors.
Drupal.AjaxCommands.prototype.removeCustomFormsError = function (ajax, response, status) {
$(response.selector).closest('.js-custom-forms-item__field').children('div.form-item--error-message').remove();
};
})(jQuery, Drupal);