Page 1 of 1

Urgent help needed ......Add dynamic table on button click

Posted: Tue May 27, 2014 10:43 pm
by snehathomas184
i need same table again when clicking ADD Button...but here when i insert some value in first table and click add button, generate th value inserted table again...i need empty table(all time.ie,after putting value in 1sttable also)

And how to insert all these tables data to database

<script language="javascript" type="text/javascript">
function Add(id){
var table=document.getElementById(id);
var clone=table.getElementsByTagName('TBODY')[0].cloneNode(true);
table.appendChild(clone);
counter++;
}


</script>
<table border="0" id="tst">
<tr>
<td>Facility Name
<label>
<input type="text" name="o_f" id="o_f" size="27"/>
</label></td>
</tr>
<tr>
<td>Address<label>
<textarea name="o_add" id="o_add" cols="23" style="margin-left:36px; margin-top:0px;"></textarea>
</label></td>
</tr>
<tr>
<td>City <label>
<input type="text" name="o_city" id="o_city" size="27" style="margin-left:63px;margin-top:-16px;"/>
</label></td>
</tr>
</table>
<input type="submit" name="button" id="button" value="ADD"><input type="button" value="Add" onclick="Add('tst');"/>

Re: Urgent help needed ......Add dynamic table on button cli

Posted: Wed May 28, 2014 6:38 am
by Celauran
Duplicate of viewtopic.php?f=13&t=139706. One topic per question is enough.