WW-2058 Client side validation in xhtml template and clearErrorMessages not working in firefox with hidden fields

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@566190 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Holmes
2007-08-15 14:35:19 +00:00
parent 91bbaf81cb
commit 6a2daa73cf
@@ -21,11 +21,19 @@
function clearErrorMessages(form) {
var table = form.childNodes[1];
if( typeof table == "undefined" ) {
table = form.childNodes[0];
// get field table
var table;
for (var i = 0; i < form.childNodes.length; i++) {
if (form.childNodes[i].tagName != null && form.childNodes[i].tagName.toLowerCase() == 'table') {
table = form.childNodes[i];
break;
}
}
if (table == null) {
return;
}
// clear out any rows with an "errorFor" attribute
var rows = table.rows;
var rowsToDelete = new Array();