Ok, I am creating a music upload program and nearing the end.
I request a bunch of tracks for an album, loop through the JSON, and use DOM methods to create a form with a input/file box for each track. I submit the form the files are uploaded, and all is well in Firefox land (naturally).
I’ve created a sandbox of my problem here.
This doesn’t submit the form in IE
[CODE]
<script type=”text/javascript”>
function init(){
var theForm = document.createElement(‘form’);
theForm.method = “POST”;
theForm.action = “index2.php”;
theForm.target = “theFrame”;
theForm.enctype = “multipart/form-data”;
var input = document.createElement(‘input’);
input.setAttribute(“type”, “file”);
input.name = “mp3[]”;
theForm.appendChild(input);
var submit = document.createElement(‘input’);
submit.setAttribute(“type”, “SUBMIT”);
theForm.appendChild(submit);
document.body.appendChild(theForm);
document.getElementById(‘theDiv’).innerHTML = ‘<iframe name=”theFrame” id=”theFrame” src=”index2.php”></iframe>’;
}
</script>
<body onLoad=”init();”>
<div id=”theDiv”></div>
</body>
However, if I create this exact same page using HTML… it works.
The music uploading part of this program is the last step… and I really don’t want to create a seperate page for this, because the rest of the program is all javascript (and 1 page).
Any ideas?