R
Rich_C
I'm able to clone a table row using this:
function insert(btn) {var cell, newRow, row, sect;
if((cell = btn.parentNode) && (row = cell.parentNode) &&
row.cloneNode && (sect = row.parentNode) && sect.insertBefore)
{
newRow = row.cloneNode(true);
/* If you need to alter the new row
* or its contents, do it here.
*/
sect.insertBefore(newRow, row.nextSibling);
}
}
the problem is that I need to change contents of 2 cells. One cell
contains an input box that should be blank in the new row, one cell
contains an input box that shoule be reset to 1 in the new row. The
script indicates that I can 'alter the new row', but how do I access
the cell contents to make changes?
Also, the button to add rows is in the last column of the row. Is
there a way to remove (or hide) it in all but the last row?
Thanks,
Rich
function insert(btn) {var cell, newRow, row, sect;
if((cell = btn.parentNode) && (row = cell.parentNode) &&
row.cloneNode && (sect = row.parentNode) && sect.insertBefore)
{
newRow = row.cloneNode(true);
/* If you need to alter the new row
* or its contents, do it here.
*/
sect.insertBefore(newRow, row.nextSibling);
}
}
the problem is that I need to change contents of 2 cells. One cell
contains an input box that should be blank in the new row, one cell
contains an input box that shoule be reset to 1 in the new row. The
script indicates that I can 'alter the new row', but how do I access
the cell contents to make changes?
Also, the button to add rows is in the last column of the row. Is
there a way to remove (or hide) it in all but the last row?
Thanks,
Rich