You are here: Re: [PHP] Submit Form Values To Parent « PHP « IT news, forums, messages
Re: [PHP] Submit Form Values To Parent

Posted by "Shaun" on 10/05/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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация