ok so I've done about a million searches on this issue but I haven't found an exact answer for this. I want to dynamically create an iframe, then set its name, then set a forms target to the iframe and submit the form.

This works:

Code:
<html>
<head>
    
</head>
<body>
<form action="http://www.google.com" method="post" target="myFrame">
<p>Hello</p>
<input type="submit" value="GO!!!!!!!!!"/>
</form>

<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<iframe name="myFrame"></iframe>

</body>
</html>
I get a nice google error in my iframe

Now what I want to do is this, which just opens a popup instead

Code:
<html>
<head>
    <script type="text/javascript">
    <!--
        onload = function () {
            document.getElementById('myFrame').name = 'myFrame';
        }
    //-->
    </script>
</head>
<body>
<form action="http://www.google.com" method="post" target="myFrame">
<p>Hello</p>
<input type="submit" value="GO!!!!!!!!!"/>
</form>

<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<iframe id="myFrame"></iframe>

</body>
</html>
Now keep in mind this is just an example, in the real thing I'm not hard coding the iframe into the document. The iframe is generated dynamically.

I found one post online talking about using document.write('<iframe name=...'), I haven't actually tried it but supposedly it works. However I'm looking for a nicer solution if one exists.

Thanks.