Skip to content

Commit

Permalink
Don't assume that form is set in reporting extension
Browse files Browse the repository at this point in the history
  • Loading branch information
cjo committed Oct 7, 2009
1 parent 7a6a938 commit d6a5c1e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/extensions/reporting.js
Expand Up @@ -132,7 +132,22 @@ v2.Object.extend(v2.Form.prototype, /** @scope v2.Form.prototype */{
return;
}

var i, element, elements, form = this.__form;
var i, element, elements, form;

try {
form = this.getInvalid()[0].getParent();

while (form.tagName.toLowerCase() != "form") {
form = form.parentNode;
}
} catch(e) {
form = this.__form;
}

if (!form) {
return;
}

elements = form.all || form.getElementsByTagName('*');

for (i = 0; (element = elements[i]); i++) {
Expand Down

0 comments on commit d6a5c1e

Please sign in to comment.