acameron
asked on
remove specific row from html table and array/string manipulation
Ok here goes,
I have a javascript which creates rows in a table based on form entries which works with no problem, now I need to delete rows but I can only seem to delete the first and last row in the table!
is there some way to set the row "id" and delete rows based on that id?
Also if you havppen to have a link to a tutorial on string and array manipulation I would appreciate it as I need to do things in javascript I do in perl like push, pop, split, join, .=, etc...
I have a javascript which creates rows in a table based on form entries which works with no problem, now I need to delete rows but I can only seem to delete the first and last row in the table!
is there some way to set the row "id" and delete rows based on that id?
Also if you havppen to have a link to a tutorial on string and array manipulation I would appreciate it as I need to do things in javascript I do in perl like push, pop, split, join, .=, etc...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Here array operations:
http://devedge.netscape.com/library/manuals/2000/javascript/1.4/reference/array.html
http://devedge.netscape.com/library/manuals/2000/javascript/1.4/reference/array.html
delete without calculation here and this :)
======================
<table cellspacing=0 cellpadding=0 border=1>
<tr><td>0</td><td style=color:red;cursor:han d onclick=parentNode.removeN ode()>X</t d></tr>
<tr><td>1</td><td style=color:red;cursor:han d onclick=parentNode.removeN ode()>X</t d></tr>
<tr><td>2</td><td style=color:red;cursor:han d onclick=parentNode.removeN ode()>X</t d></tr>
<tr><td>3</td><td style=color:red;cursor:han d onclick=parentNode.removeN ode()>X</t d></tr>
<tr><td>4</td><td style=color:red;cursor:han d onclick=parentNode.removeN ode()>X</t d></tr>
<tr><td>5</td><td style=color:red;cursor:han d onclick=parentNode.removeN ode()>X</t d></tr>
</table>
======================
<table cellspacing=0 cellpadding=0 border=1>
<tr><td>0</td><td style=color:red;cursor:han
<tr><td>1</td><td style=color:red;cursor:han
<tr><td>2</td><td style=color:red;cursor:han
<tr><td>3</td><td style=color:red;cursor:han
<tr><td>4</td><td style=color:red;cursor:han
<tr><td>5</td><td style=color:red;cursor:han
</table>
http://www.jimparshall.net/javascript/javascript_strings.aspx
you can hide rows in table with
document.getElementById(<t
[<rownum>].style.visibilit