Jump to content

Problem with form submit


Dr-Neo

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/108278-problem-with-form-submit/
Share on other sites

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

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.