diff --git a/src/js/validatr.js b/src/js/validatr.js index 805355f..ae5e843 100644 --- a/src/js/validatr.js +++ b/src/js/validatr.js @@ -629,8 +629,8 @@ } }, - getElements: function (form) { - if (this.formElements) { + getElements: function (form, refresh) { + if (this.formElements && !refresh) { return this.formElements; } @@ -645,6 +645,12 @@ return elements; }, + + refreshElements: function () { + this.formElements = this.getElements(this.el, true) + .on('valid.' + 'validatr', $.proxy(validElement, this)) + .on('invalid.' + 'validatr', $.proxy(invalidElement, this)); + }, validateElement: function (element) { if (!element) {