...

View Full Version : using InnerHtml to dynamically add the rows



itsmaheshp
01-25-2006, 07:27 AM
Hi All,
i am having a tale in HTML page which is having set of rows.
<table id="tabid"><tr><input ...><img src="add-row.gif"> </tr>
<tr><input ...></tr>
<tr><input ...></tr>
<tr><input ...></tr>
<!-- need to ad a row here-->
</table>

i need to code a javascript to add a row similar to the one present above when u clik on add-row.gif image but for the 1st row del-row.jpg shud be there to delete the row.

see the attached file for code

though this code will give u an idea(but is not complete...similar code is written for the other rows also...)
I am able to add the rows successfully but facing the probs while deleting..
facing probs while deleting the 2nd row...3rd row gets deleted..

pls helpme

Thanks & Regards
Mahesh P

vwphillips
01-25-2006, 08:31 AM
using innerHTML is NOT the way to do this if you are interested in a DOM solution say



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum