I use javascript to dynamically add textfields to a div
function moreLink(){
//gco is global, starts from 1, limit of textfields added is 10
if (gco!=10){
var newLinkb=[];
document.getElementById("extraLink").innerHTML+="<br>";
newLinkb[gco]= document.createElement('input');
newLinkb[gco].setAttribute('type','text');
newLinkb[gco].setAttribute('id',gco);
document.getElementById("extraLink").appendChild(newLinkb[gco]);
gco++;
}
else{ alert ('sorry, cannot add more, limit is 10');
}
}
So, when I hit the right button, calls the moreLink
function wich adds a new textfield input type.
The problem is ,if I write something in the first textfield and hit the button, a second textfield appears, but the text in the first one (the value), dissappears.
How do I fix this?
Thanks