From fef92aa59b0d85375b7c5c84222888e39d11e71e Mon Sep 17 00:00:00 2001 From: Igor Yasko Date: Fri, 23 Feb 2018 13:57:33 +0300 Subject: [PATCH] Has been fixed issue of duplicate ID in the preparePrototype method. --- Resources/public/js/FpJsFormValidator.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Resources/public/js/FpJsFormValidator.js b/Resources/public/js/FpJsFormValidator.js index dfc3e88..bb46041 100644 --- a/Resources/public/js/FpJsFormValidator.js +++ b/Resources/public/js/FpJsFormValidator.js @@ -304,8 +304,7 @@ function FpJsCustomizeMethods() { FpJsFormValidator.each(this, function (item) { var prototype = FpJsFormValidator.preparePrototype( FpJsFormValidator.cloneObject(item.jsFormValidator.prototype), - name, - item.jsFormValidator.id + '_' + name + name ); item.jsFormValidator.children[name] = FpJsFormValidator.createElement(prototype); item.jsFormValidator.children[name].parent = item.jsFormValidator; @@ -954,15 +953,14 @@ var FpJsFormValidator = new function () { * * @param {Object} prototype * @param {String} name - * @param {String} id */ - this.preparePrototype = function (prototype, name, id) { + this.preparePrototype = function (prototype, name) { prototype.name = prototype.name.replace(/__name__/g, name); - prototype.id = prototype.id.replace(/__name__/g, id); + prototype.id = prototype.id.replace(/__name__/g, name); if (typeof prototype.children == 'object') { for (var childName in prototype.children) { - prototype[childName] = this.preparePrototype(prototype.children[childName], name, id); + prototype[childName] = this.preparePrototype(prototype.children[childName], name); } }