This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Edit & Delete Table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Edit & Delete Table" Watch "Edit & Delete Table" New topic
Author

Edit & Delete Table

Bacchi Gerem
Ranch Hand

Joined: Jan 23, 2004
Posts: 120
Hi,
Sample code:

<script type="text/javascript">
function addRow(content,morecontent)
{
if (!document.getElementsByTagName) return;
tabBody=document.getElementsByTagName("TBODY").item(0);
row=document.createElement("TR");
cell1 = document.createElement("TD");
cell2 = document.createElement("TD");
textnode1=document.createTextNode(content);
textnode2=document.createTextNode(morecontent);
cell1.appendChild(textnode1);
cell2.appendChild(textnode2);
row.appendChild(cell1);
row.appendChild(cell2);
tabBody.appendChild(row);


}
</script>

How can i delete a row and edit a row in a table.

If i select a row in a table to edit i get the information in textboxes.

I want to change the value in text box .

Thanks
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Delete row: http://developer.mozilla.org/en/docs/DOM:table.deleteRow

Edit: look at the cells' innerHTML

Eric
 
Don't get me started about those stupid light bulbs.
 
subject: Edit & Delete Table
 
Similar Threads
selecting dynamically added rows of a table
Using JavaScript to Add Rows to a Table
adding cell values in a dynamically added row
Dynamic rows validation from javascript
spaces while populating using s:iterator