Append more that one control to div
- by Kemrop
Ok this will be quick. I am collecting data in div by inserting hidden input boxes before i eventually submit to the server.
here is Javascript code.
function appendToDiv()
{
var mydiv=document.getElementById("somediv");
var mydata=document.getElementsByName("description")[0].value;
var myurl=document.getElementsByName("url")[0].value;
var data=mydata+myurl;
mydiv.innerHTML="<input type='hidden' name='sUrl[]'value='"+data+"'/"
}
I have an onchange event that keeps calling the above guy until i am satisfied that i have all i need to send to the server.Problem is only one input get appended to the div.What could i be missing.