....
<table id="tbl">
<div id="xtra" style="display:none; visibility:hidden">
</div>
<div id="dname" style="display:none; visibility:hidden">
<input name="Name[]" type="text" size="35">
</div>
</table>
....
<input type="button"
name="Add"
value="More Company"
onclick="return AddRow();">
....
//the following javascript function is saved in another .js file which is then called from the main php file when the above button is clicked. It works fine with Mozilla and Chrome.
function AddRow()
{
var morerow=document.getElementById("tbl")
var newtr=document.createElement("tr");
var dname=document.getElementById("dname");
morerow.appendChild(newtr);
var newtd0 = document.createElement("td");
newtd0.innerHTML = xtra.innerHTML;
newtr.appendChild(newtd0);
var newtd1 = document.createElement("td");
newtd1.innerHTML = dname.innerHTML;
newtr.appendChild(newtd1);
};
What's wrong with IE8?