title: Submit form into an iframe target with javascript
body: <p>I'm trying to open a web page with POST and parameters into an iframe.
  But when submit is made the parent page is reloaded and the URL did not open into the iframe:</p>
  
  <pre><code>&lt;head&gt;
      &lt;title&gt;iframe Example&lt;/title&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
      &lt;style&gt;
      iframe {
          display: block;       /* iframes are inline by default */
          background: #000;
          border: none;         /* Reset default border */
          height: 90vh;        /* Viewport-relative units */
          width: 90vw;
      }
      &lt;/style&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;form id="myForm" method="post" action= "http://127.0.0.1/myWeb" target="myIframe"&gt;
      &lt;input type = "hidden" name="param1" value="param1value"&gt;
      &lt;input type = "hidden" name="param2" value= "param1value"&gt;
      &lt;/form&gt;
       &lt;a href="" onClick="postLogin();" &gt;Send to iframe&lt;/a&gt;&lt;br /&gt;
      &lt;script laguaje="javascript"&gt;
          function postLogin() {
              var form = document.getElementById("myForm");
              form.submit();
          }
      &lt;/script&gt;
       &lt;iframe  src="" name="myIframe" id="myIframe"&gt;
         &lt;p&gt;iframes are not supported by your browser.&lt;/p&gt;
       &lt;/iframe&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>