chandra prabha Posted October 1, 2009 Share Posted October 1, 2009 in login.php <iframe name="foo" id="foo" src="flowerpodLogin.php" frameborder="0" style="display:none" > </iframe> 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" /> <input type="hidden" name="ipb_stronghold" value="5e8785478cd79872a36cda22a2636b31" /> --> <input type="hidden" name="coppa" value="0" /> <input type="submit" name="flowerpodSubmit" id="flowerpodSubmit" /> </form> <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 </script> Now i want to submit the form automatically. the code in js shows error. Link to comment https://forums.phpfreaks.com/topic/176150-submit-a-form-inside-iframeinvisible-automatically/ Share on other sites More sharing options...
prasanthmj Posted October 1, 2009 Share Posted October 1, 2009 It should be document.frmID.submit() or document.forms["frmID"].submit(); or document.getElementById('frmID').submit(); Link to comment https://forums.phpfreaks.com/topic/176150-submit-a-form-inside-iframeinvisible-automatically/#findComment-928276 Share on other sites More sharing options...
ProXy_ Posted October 4, 2009 Share Posted October 4, 2009 You can try this: login.php <iframe name="foo" id="foo" src="flowerpodLogin.php" frameborder="0" style="display:none"> </iframe> flowerpodLogin.php <html> <head> <script language="javascript"> function SubmitForm() { document.getElementById('foo').submit(); } </script> </head> <body onload="SubmitForm()"> <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" /> <input type="hidden" name="ipb_stronghold" value="5e8785478cd79872a36cda22a2636b31" /> --> <input type="hidden" name="coppa" value="0" /> <input type="submit" name="flowerpodSubmit" id="flowerpodSubmit" /> </form> That should help you out. Link to comment https://forums.phpfreaks.com/topic/176150-submit-a-form-inside-iframeinvisible-automatically/#findComment-929971 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.