Submit a form inside iframe(invisible) automatically

in login.php

<iframe name=“foo” id=“foo” src=“flowerpodLogin.php” frameborder=“0” style=“display:none” >


in flowerpodLogin.php

<form name=“frmID” id=“frmID” method=“post” target =“foo” action=“path?act=Login&CODE=01”>
<input type=“hidden” name=“UserName” value=“nivethak” />
<input type=“hidden” name=“PassWord” value=“test123” />
<input type=“hidden” name=“submit” value=“Log me in” />
<input name=“referer” type=“hidden” value=“path/index.php?” />
<input type=“hidden” name=“CookieDate” value=“1” />
<input type=“hidden” name=“pass_hash” value=“0” />
<input type=“hidden” name=“member_id” value=“0” />
<input type=“hidden” name=“anonlogin” value=“-1” />
<!-- <input type=“hidden” name=“session_id” value=“daec59931c7098785e65aaf748286a3d” />

				&lt;input type="hidden" name="ipb_stronghold" value="5e8785478cd79872a36cda22a2636b31" /&gt;  --&gt;
					&lt;input type="hidden" name="coppa" value="0" /&gt;

 &lt;input type="submit" name="flowerpodSubmit" id="flowerpodSubmit" /&gt;


<script language=“javascript”>
// document.parent.frmID.submit(); - throws document.parent is undefined
//document.frmID.submit();–throws submit() is not function error
//document.getElementById(“foo”).frmID.submit() - throw document.getElementById(“foo”) is null

Now i want to submit the form automatically. the code in js shows error.

If the target for is located in login.php and you are trying to access it from flowerpodLogin.php, then you would have to write:

Submitting a form in the same window would be written:

To execute this on load of a page, you have to either place the command in an ONLOAD event of the BODY tag, or inside a SCRIPT tag placed just before the closing BODY tag.