System: The following message was cut out of thread at:
http://www.webmasterworld.com/javascript/4169757.htm [webmasterworld.com] by fotiman - 11:25 am on Dec 7, 2010
(utc -4)
Hi Fotiman,
I'm facing a similar problem. It'd be of great help if you could take time out and look into it once.
I want to repeat a block of code in html,
Here is the function in javascript that i wrote :
function createcontrols(div) {
var ediv=document.getElementById(div);
var temp=ediv.innerhtml;
var newdiv = document.createElement('div');
newdiv.innerhtml =temp;
ediv.parentNode.insertBefore(newdiv, ediv.nextSibling);
}
And here's the html code :
<asp:Button ID="btnAddTaxDoc" runat="server" onclick="createcontrols('item')" Text="+"/>
<br />
<div id="item">
<a onclick="Toggle(this)" style="cursor:pointer;"><img src="plus.gif" alt="Expand/Collapse" />
<asp:Label ID="lblTaxDocument" runat="server" Text="Tax Document"></asp:Label></a>
<table class="style5" id="tbltax">
<td>
<asp:Label ID="lblTaxDocName" runat="server" Text="Name"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtTaxDocName" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblTaxDocDate" runat="server" Text="Date"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtTaxDocDate" runat="server"></asp:TextBox>
</td>
</tr> </table>
</div>
P.S : I have written function for Toggle(node)
The error i am getting when i execute this is "Too many characters in character literal".
Could you please direct me where i'm going wrong?
Thanks in advance.