M
Mister Joe
I'm trying to use javascript to clone a form but have hit a wall. I
have a form in a table row and need to copy the form as well as the
table elements:
<table>
<tr id = "foo"><form><td><input /><</td></form></td>
</table>
foo.firstChild.length = 1
after copy:
<table>
<tr id = "foo"><form><td><input /><</td></form></td>
<tr id = "bar"><form><td><input /><</td></form></td>
</table>
foo.firstChild.length = 0
When I copy the table row as well as the form elements it's seems like
the elements are loosing their association with the form. Is there
some extra step that needs to be taken? I thought about cloning the
input element nodes after I rename them and appending the clone to the
form tag but that would result in having duplicate elements on the
page. Any suggestions would be appreciated.
have a form in a table row and need to copy the form as well as the
table elements:
<table>
<tr id = "foo"><form><td><input /><</td></form></td>
</table>
foo.firstChild.length = 1
after copy:
<table>
<tr id = "foo"><form><td><input /><</td></form></td>
<tr id = "bar"><form><td><input /><</td></form></td>
</table>
foo.firstChild.length = 0
When I copy the table row as well as the form elements it's seems like
the elements are loosing their association with the form. Is there
some extra step that needs to be taken? I thought about cloning the
input element nodes after I rename them and appending the clone to the
form tag but that would result in having duplicate elements on the
page. Any suggestions would be appreciated.