PDA

View Full Version : how to delete added rows ??


PHPycho
04-04-2007, 12:17 PM
Hello forums !!
I had used the following javascript code for adding rows

function addRow(row)
{
table = row.parentNode.parentNode;
pos = row.rowIndex;

// Row for file
k = 0;
row = table.insertRow(pos);
cell = row.insertCell(k++);
//cell.setAttribute('align','right');
cell.innerHTML = 'File Upload';
cell = row.insertCell(k++);
cell.innerHTML = '<input type="text" name="title[]" class="text" />';
}

for event handling
<input class="text" type="button" name="add" value="add more &raquo;" onclick="addRow(this.parentNode.parentNode)" />

I want to make some change with the function.
I want to add a function that deletes the row created by js
how to perform such ?
Please help me. Any help and suggestions will be highly appreciated.
Thank you

shyam
04-04-2007, 04:25 PM
try looking up here (http://w3schools.com/htmldom/met_table_deleterow.asp)