title: HTML Form element loaded from a page inside of an iframe unable to set target to another iframe in the page when n IE
body: <p>I have a page loading inside of an iframe, on that page is a form element with two file input tags whose target is set to an iframe inside of same page as the form. When the form is submitted it sends the files to a JSP page which when after processing the fileupload returns writes out some javascript notifying the user that upload has completed and performs some other processing. On FF and Chrome this setup works just fine but for some reason in IE instead of having the form action load inside of the iframe a new window pops up. </p>
  
  <p>I insert the form, inputs and iframe into the DOM of the page that's loaded into the first iframe via the javascript below:</p>
  
  <pre><code>var containerDiv = document.createElement('div');
  containerDiv.setAttribute("id", "containerDiv");
  containerDiv.style.position = "absolute";
  containerDiv.style.top = "360px";
  containerDiv.style.left = "20px";
  containerDiv.style.width = "300px"
  
  var iFrame = document.createElement('iframe');
  iFrame.setAttribute("id", "target-iframe");
  iFrame.name = "target-iframe";
  iFrame.style.visibility = "hidden";
  iFrame.style.height = "50px";
  
  var zipInput = document.createElement('input');
  zipInput.setAttribute("type", "file");
  zipInput.setAttribute("id", "zipInput");
  zipInput.setAttribute("name", "test");
  zipInput.setAttribute("title", "Test");
  zipInput.style.marginBottom = "10px";
  
  var pdfInput = document.createElement('input');
  pdfInput.setAttribute("type", "file");
  pdfInput.setAttribute("id", "pdfInput");
  pdfInput.setAttribute("name", "test");
  pdfInput.setAttribute("title", "Test");
  
  var form = document.createElement('form');
  form.setAttribute("id", "uploadForm");
  form.setAttribute("enctype", "multipart/form-data");
  form.setAttribute("action", "http://servername:8090/xmlserver/jsp/Upload.jsp?BatchID=" + CSForm.getField("BatchID").getValue());
  form.setAttribute("method", "POST");
  
  document.getElementById("DFS__pagediv1").appendChild(containerDiv);
  document.getElementById("containerDiv").appendChild(form);
  document.getElementById("containerDiv").appendChild(iFrame);
  document.getElementById("uploadForm").appendChild(zipInput);
  document.getElementById("uploadForm").appendChild(pdfInput);
  </code></pre>
  
  <p>I've set the form target to the iframe name per the code below but it still pops up a new window for IE. </p>
  
  <pre><code>document.getElementById('uploadForm').target = document.getElementById("target-iframe").name;
  alert(document.getElementById('uploadForm').target);
  document.getElementById('target-iframe').style.visibility="Visible";
  document.getElementById("uploadForm").submit();
  </code></pre>
  
  <p>I hope that it's something basic that I'm missing and I would really appreciate any help or workarounds that you might have.</p>
  
  <p>Thank you in advance!</p>