Re: Submit Form Values To Parent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx> wrote in message 
news:43900B36.50908@xxxxxxxxxxxxxxxx
>
>
> 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. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux