DependsOn update 2.0.0
Default validation msg for validate action.
(function ($, ns) {
'use strict';
+ const DEFAULT_MSG = 'Incorrect data';
const INVALID_CLASS = 'dependsOnValidate-invalid';
const DATA_MSG_ATTR = 'data-dependson-validate-msg';
const DATA_MARKER_ATTR = 'data-dependson-validate';
if (typeof result === 'string') {
this.$el.attr(DATA_MARKER_ATTR, result);
} else {
- this.$el.attr(DATA_MARKER_ATTR, result ? '' : this.$el.attr(DATA_MSG_ATTR));
+ this.$el.attr(DATA_MARKER_ATTR, result ? '' : (this.$el.attr(DATA_MSG_ATTR) || DEFAULT_MSG));
}
ns.ElementAccessors.updateValidity(this.$el, true); // force validation
});
