Adding an <img src> to an existing table cell dynamically
843833Jul 18 2001 — edited Jul 18 2001Hi All-
I am currently developing a jsp that displays dynamic information from a database and allows the end user to alter that data. I am displaying this data through a dynamically created table in a jsp.
I would like for an <img> tag to be placed into a preset cell on this dynamic table once the user has made a change to the cooresponding record.
I have attempted to use a javascript function attached to the input tag event handler to update the <td> tag (which I have given a unique ID to) so that the image is added to the cell.
However I have continually gotten errors in trying this. Attached is the relative code. Any help would be greatly appreciated .. and rewarded w/ Duke dollars.
Javascript Function ------------------------
function changedStatus(tdObj){
tdObj.add(<img src="../images/pin_or.gif" class=changeLogo>);
}
JSP Code----------------------------------
while(returnRows.hasNext()){
LineItem currentLine = (LineItem)(returnRows.next());
Iterator lineIterator = currentLine.iterator();
rowCount++;
%>
<tr class=<%=(rowCount%2 == 0)?"primary":"secondary"%>>
<td id='changed<%=rowCount%>'> </td>
<td><div align="center"><%=currentLine.getOrderId()%></div></td>
<td><div align="center"><select name="selectStatus" onclick="changedStatus('changed<%=rowCount%>')">