Link to home
Start Free TrialLog in
Avatar of acameron
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...
Avatar of apparition
apparition

String functions can be found here
http://www.jimparshall.net/javascript/javascript_strings.aspx

you can hide rows in table with
document.getElementById(<tableid>).rows
[<rownum>].style.visibility="hidden";
ASKER CERTIFIED SOLUTION
Avatar of NetGroove
NetGroove

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of devic
delete without calculation here and this :)

======================
<table cellspacing=0 cellpadding=0 border=1>
<tr><td>0</td><td style=color:red;cursor:hand onclick=parentNode.removeNode()>X</td></tr>
<tr><td>1</td><td style=color:red;cursor:hand onclick=parentNode.removeNode()>X</td></tr>
<tr><td>2</td><td style=color:red;cursor:hand onclick=parentNode.removeNode()>X</td></tr>
<tr><td>3</td><td style=color:red;cursor:hand onclick=parentNode.removeNode()>X</td></tr>
<tr><td>4</td><td style=color:red;cursor:hand onclick=parentNode.removeNode()>X</td></tr>
<tr><td>5</td><td style=color:red;cursor:hand onclick=parentNode.removeNode()>X</td></tr>
</table>