jbot
05-25-2004, 04:28 PM
can anyone explain this bahviour to me. when i call a function to check on the id of a previous element in the tree, IE correctly identifies it, but Mozilla get's the wrong name altogether.
the first block of code is the HTML/JSP. please note, this includes Struts tags, so ignore them since they ain't relevant:
<tr>
<td id="trial-td-1-a"><div class="disabledlabel"><bean:write name="UserLogEventForm" property="userlistlabel(e1functionalArea)"/></div></td>
<td id="trial-td-1-b"></td>
<td>
<html:select property="userlist(e1functionalArea).selected" disabled="true">
<option value="" SELECTED><fmt:message key="fault.defect.e2functionalArea"/></option>
<html:options property="userlistvalue(e1functionalArea)"/>
</html:select>
</td>
<td></td>
<td><div class="errormsg"><html:errors property="userlist(e1functionalArea).selected"/></div></td>
</tr>
this next block is the JS alert used to check the id of 2nd previous sibling of the selectbox. it should return "trial-td-1-a", but it only does so in IE. Firefox get's it wrong and goes for the first previous sibling "trial-td-1-b". this is the alert call (btw: aElms[j] is the form element calling it's parent node, etc):
alert("name = " + aElms[j].parentNode.previousSibling.previousSibling.id) ;
what's going on? :confused:
the first block of code is the HTML/JSP. please note, this includes Struts tags, so ignore them since they ain't relevant:
<tr>
<td id="trial-td-1-a"><div class="disabledlabel"><bean:write name="UserLogEventForm" property="userlistlabel(e1functionalArea)"/></div></td>
<td id="trial-td-1-b"></td>
<td>
<html:select property="userlist(e1functionalArea).selected" disabled="true">
<option value="" SELECTED><fmt:message key="fault.defect.e2functionalArea"/></option>
<html:options property="userlistvalue(e1functionalArea)"/>
</html:select>
</td>
<td></td>
<td><div class="errormsg"><html:errors property="userlist(e1functionalArea).selected"/></div></td>
</tr>
this next block is the JS alert used to check the id of 2nd previous sibling of the selectbox. it should return "trial-td-1-a", but it only does so in IE. Firefox get's it wrong and goes for the first previous sibling "trial-td-1-b". this is the alert call (btw: aElms[j] is the form element calling it's parent node, etc):
alert("name = " + aElms[j].parentNode.previousSibling.previousSibling.id) ;
what's going on? :confused: