im creating controls using javascript, but whenever there is a postback on the page all the controls created in javascript disappear.
How do i fix this problem.
the code below shows how im creating them.
How do i fix this problem.
the code below shows how im creating them.
Code:
var txt5 = document.createElement("input");
txt5.setAttribute ('type', 'text');
txt5.setAttribute ('id', j[0]);
txt5.setAttribute ('name', j[0]);
txt5.setAttribute ('text', j[0]);
var chk1 = document.createElement("input");
chk1.setAttribute ('type', 'checkbox');
chk1.setAttribute ('id', "chk" + j[0] );
chk1.setAttribute ('name',"chk" + j[0]);
chk1.setAttribute ('text',"chk" + j[0]);
//chk1.innerHTML = "Default";
var lbl1 = document.createElement('label');
lbl1.setAttribute ('id', "lblDefault" );
lbl1.innerHTML = "Default";
lbl1.style.width = "30px";
var lbl3 = document.createElement('label');
lbl3.setAttribute ('id', "lbl" + j[0]);
lbl3.innerHTML = j[0];
lbl3.style.width = "125px";
txt5.style.top='15px';
txt5.style.left='15px';
var newdiv = document.createElement('div');
di.setAttribute('id',"divIdName");
di.appendChild(lbl3);
di.appendChild(txt5);
Comment