diff --git a/lib/form/form.js b/lib/form/form.js index e2f743e2a8a..938fab6be66 100644 --- a/lib/form/form.js +++ b/lib/form/form.js @@ -237,7 +237,7 @@ M.form.initFormDependencies = function(Y, formid, dependencies) { _dependency_notchecked : function(elements, value) { var lock = false; elements.each(function(){ - if (this.getAttribute('type').toLowerCase()=='hidden' && Y.Node.getDOMNode(this).ancestor('div.felement.fcheckbox')) { + if (this.getAttribute('type').toLowerCase()=='hidden' && !this.siblings('input[type=checkbox][name="' + this.get('name') + '"]').isEmpty()) { // This is the hidden input that is part of an advcheckbox. return; } @@ -254,7 +254,7 @@ M.form.initFormDependencies = function(Y, formid, dependencies) { _dependency_checked : function(elements, value) { var lock = false; elements.each(function(){ - if (this.getAttribute('type').toLowerCase()=='hidden' && Y.Node.getDOMNode(this).ancestor('div.felement.fcheckbox')) { + if (this.getAttribute('type').toLowerCase()=='hidden' && !this.siblings('input[type=checkbox][name="' + this.get('name') + '"]').isEmpty()) { // This is the hidden input that is part of an advcheckbox. return; } @@ -284,7 +284,7 @@ M.form.initFormDependencies = function(Y, formid, dependencies) { elements.each(function(){ if (this.getAttribute('type').toLowerCase()=='radio' && !Y.Node.getDOMNode(this).checked) { return; - } else if (this.getAttribute('type').toLowerCase() == 'hidden' && Y.Node.getDOMNode(this).ancestor('div.felement.fcheckbox')) { + } else if (this.getAttribute('type').toLowerCase() == 'hidden' && !this.siblings('input[type=checkbox][name="' + this.get('name') + '"]').isEmpty()) { // This is the hidden input that is part of an advcheckbox. hidden_val = (this.get('value') == value); return; @@ -321,7 +321,7 @@ M.form.initFormDependencies = function(Y, formid, dependencies) { elements.each(function(){ if (this.getAttribute('type').toLowerCase()=='radio' && !Y.Node.getDOMNode(this).checked) { return; - } else if (this.getAttribute('type').toLowerCase() == 'hidden' && Y.Node.getDOMNode(this).ancestor('div.felement.fcheckbox')) { + } else if (this.getAttribute('type').toLowerCase() == 'hidden' && !this.siblings('input[type=checkbox][name="' + this.get('name') + '"]').isEmpty()) { // This is the hidden input that is part of an advcheckbox. hidden_val = (this.get('value') != value); return;