I'm trying to modernize an intranet site somebody has built in the past which at the moment is forced into compatibility mode for IE5 through group policy. There is this javascript which creates x ammount of file input boxes within a form. This works on compatibility mode up to IE9 but not higher. I don't really know javascript I was hoping someone could help me modernize it?
<SCRIPT LANGUAGE="JavaScript">
var i = 0, j = 0;
var t1 = new Array();
function createtext() {
var inputLoop = document.getElementById("Many");
var table1 = document.getElementById("field");
for (i = 0; i < inputLoop.value; i++)
{
t1[i] = document.createElement('input');
t1[i].type = 'file';
t1[i].name = 'Image' + i;
t1[i].value = "Hello";
t1[i].size = 20;
document.forms[0].appendChild(t1[i]);
}
}
</SCRIPT>
<input name="b1" type="button" onClick="createtext();" value="Add">
If I run it on higher than IE9 the 'Add' button does nothing