diff --git a/src/js/validatr.js b/src/js/validatr.js index 805355f..78d61d8 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; } @@ -646,6 +646,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) { throw new Error('method requires an element');