title: Append current form data to iframe
body: <p>I want to append the current form data to the iframe and submit the form within iframe instead of original form. Below is code snippet</p>
  
  <pre><code>  &lt;script&gt; 
     $(document).ready(function() {
      $("#imageSubmit").click(function(e) {
       e.preventDefault(); 
       $("#wrapper iframe").remove();
       $("#wrapper").append("&lt;iframe src=''&gt;" + $("#imageForm").html()+"&lt;/iframe&gt;");
       $("#wrapper iframe form").submit();
       $("#wrapper iframe").load(checkStatus);
      });
     });
  
     function checkStatus() {
      var status = $.parseJSON($("#wrapper iframe").html());
      if (status.success) {
       alert("File " + status.filename + " uploaded!");
      } else {
       alert("Fail!");
      }
     }
    &lt;/script&gt;
  
  &lt;body&gt;
    &lt;div id="wrapper"&gt;
     &lt;form name="imageForm" id="imageForm" action="SOMETHING"&gt;
      &lt;input type="file" id="imageInput" /&gt;
      &lt;input type="submit" id="imageSubmit" /&gt;
     &lt;/form&gt;
    &lt;/div&gt;
  &lt;/body&gt;  
  </code></pre>
  
  <p>however, insted of appending the current form HTML to iframe it is adding the decoded HTML(excuse me for this word) to iframe.
  Here is iframe output i got:</p>
  
  <pre><code>    &lt;iframe&gt;
          &amp;lt;input type="file" id="imageInput"&amp;gt;
          &amp;lt;input type="submit" id="imageSubmit"&amp;gt; 
     &lt;/iframe&gt;
  </code></pre>
  
  <p>Please suggest.</p>