Dr-Neo Posted June 1, 2008 Share Posted June 1, 2008 Hello , i have a problem with form. i want submit a form to page that appear in iframe in the same page. and this ifram have to appear instead of the form it self. simple example here in www.tinypic.com when you upload the image the action page appear instead of the form. i used this code <html> <script language="javascript"> function toggleFRAME(id) { var div = document.getElementById(id); div.style.display = "block"; div.innerHTML="<iframe name='IFRAMENAME' src='PAGENAME.PHP'></iframe>"; } </script> <body> <form method="POST" action="PAGENAME.PHP" target="IFRAMENAME"> <input type="text" name="USERINPUT" id="SOME_INPUT" value=""> <br /> <input type="submit" value="SUBMITTED" name="SUBMIT" id="THIS_IS_SUBMITTING" onclick="javascript:toggleFRAME('divID');"> </form> <div id="divID"></div> </body> </html> when i used this code the iframe appear but its appear next of the form. that mean the form steal in the page. any want can help me in this issue? thank you Quote Link to comment https://forums.phpfreaks.com/topic/108278-problem-with-form-submit/ Share on other sites More sharing options...
Dr-Neo Posted June 2, 2008 Author Share Posted June 2, 2008 no ideas? Quote Link to comment https://forums.phpfreaks.com/topic/108278-problem-with-form-submit/#findComment-555447 Share on other sites More sharing options...
hansford Posted June 2, 2008 Share Posted June 2, 2008 youre going to have to let php echo it all out...the form iframe etc. $str = "<script language='javascript'>"; $str .= "<iframe name='IFRAMENAME' src='PAGENAME.PHP'></iframe>"; $str .= "<form method="POST" action="PAGENAME.PHP" target="IFRAMENAME">; then when the page is submitted back to this page have checks to see that the form has been submitted ie use $_POST if it has been submitted then you know that you dont want to echo the form Quote Link to comment https://forums.phpfreaks.com/topic/108278-problem-with-form-submit/#findComment-555550 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.