diff --git a/lib/form/form.js b/lib/form/form.js index 81f2b3bf00c..2eaea03d9ff 100644 --- a/lib/form/form.js +++ b/lib/form/form.js @@ -96,7 +96,7 @@ if (typeof M.form.dependencyManager === 'undefined') { allnames[name].push(node); } }); - this._nameCollections = [names, allnames]; + this._nameCollections = {names: names, allnames: allnames}; }, /** @@ -111,7 +111,7 @@ if (typeof M.form.dependencyManager === 'undefined') { if (includeGroups === undefined) { includeGroups = false; } - var collection = (includeGroups ? 1 : 0); + var collection = (includeGroups ? 'allnames' : 'names'); if (!this._nameCollections) { this.initElementsByName();