When the user selects a file to upload , i want to create a table dynamically showing some data related to file in the table created.Issue is my code works fine in Chrome and FF but not in IE. Please find the working sample(chrome and FF but not in IE) in "http://jsfiddle.net/v48mH/2/". Please suggest how to modify my code so that it will work in IE. Below is the code:
HTML code:
<input type="file" name="fileUpload" size="50" id="file1" multiple/>
<table border="1" id="uploadTable" style="visibility:hidden">
<tr> <th>SNo</th><th>FileName</th><th>Action</th> </tr>
</table>
JavaScript code:
var rowN = 0;var count = 1;
document.getElementById("file1").onchange = function() {
document.getElementById("uploadTable").style.visibility="visible";
var filename = "sample.txt";
var table = document.getElementById("uploadTable");
var row = '<tr><td><input type="text" name="sno" id="sno' + rowN + '" value="' + count + '"/></td><td><input type="text" name="fileName" id="fileName' + rowN + '" value="' + filename + '"/></td> <td width="100%">delete</td></tr>';
//document.getElementById("uploadTable").value = file.size + " bytes";
//document.getElementById("fileName").value = file.name;
table.innerHTML = table.innerHTML + row;
rowN++;
count++;
};