
dynamic forms inside dynamic tables
fm is a reference to the table that is being added to.
var newRow=fm.insertRow()
insertRoleCell(newRow, '<form name="role" method="post"><input type="hidden"
name="audID" value="' + aid + '"> ')
insertRoleCell(newRow, '<input type="text" name="role" size="21"
class="select" value="' + rn + '">')
insertRoleCell(newRow, '<input type="text" class="select" size="75"
name="descr" value="' + rt + '">')
insertRoleCell(newRow, '<input type="button" value="ADD"
onClick="saveRole(this)"></div></form>')
function insertRoleCell(ref, txt) {
var newCell=ref.insertCell()
newCell.innerHTML=txt;
Quote:
}
Given the above, the only element that is within the form "role" is "audID".
The other elements are lost.
Quote:
> Some code would help to understand the problem
> > I'm using the insertRows, insertCells methods to add rows to a table.
Then
> > each new row *should* contain it's own form with form elements inside
each
> > cell.
> > I use innerHTML='stuff' to insert the form tag in the first cell then
> > elements in subsequent cells and the closing form tag in the last cell.
(in
> > all calling insertCell & innterHTML 11 times per row)
> > The problem is that it seems IE only recognized elements in that first
cell,
> > as though the innerHTML property automatically includes closing tags for
> > you. I've checked the document.forms.length property to verify that it
is
> > inserting the new forms. It will see any elements in inserted in that
first
> > cell but will not see any elements in any of the other cells.
> > Any ideas why it's doing this and what I can do to make the form span
the
> > entire row? (can't use layers)
> > thanks