Posted by "Shaun" on 10/20/48 11:33
Hi all,
I have made an example of this now. If you click on this link:
http://www.assertia.com/iframe.html
and then click on 'Click Here'. I am trying to display the form results in
the parent window, but I am having no luck!
Here is my code:
iframe.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<iframe src="form.html"></iframe>
</body>
</html>
form.html:
<form name="myform">
<input type="hidden" name="text" value="test">
<a href="result.php" target="_parent"
onclick="document.myform.submit();">Click here</a>
</form>
result.php:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?= print_r($_POST); ?>
</body>
</html>
Any ideas?
"Terence" <terencel@sunway.edu.my> wrote in message
news:43900B36.50908@sunway.edu.my...
>
>
> Shaun wrote:
>> Hi,
>>
>> How can I get the form values submitted from an iframe where the target
>> is the parent window?
>
> Use Javascript. Check out irt.org -> Javascript
> They have lots of great examples.
Navigation:
[Reply to this message]
|