...

View Full Version : capture parameter from iframe to main.html



dark0s
08-28-2010, 05:54 PM
I have the following HTML code in main.html:


.............
.............
<tr align="right">
<td width="50%">
...
...
...
</td>
<td width="50%">
<iframe src="../createproject.html width="100%" height="400pt" frameborder="0" scrolling="no">
</iframe>
</td>
</tr>
...........
...........


and createproject.html:


<html>
<head>
<link rel="stylesheet" type="text/css" href="../user.css" />
<script type="text/javascript" src="../projects.js"></script>
<head>
<body onload="return capture_profile()">
<div align="right" class="data-font">
<form action="/cgi-bin/createproj.cgi" method="POST">
<fieldset>
.......
.......
.......
</fieldset>
</form><br/>
</div>
</body>
</html>


I'd like capture with capture_profile() function in createproject.html a value into main.html page.
How can I solve this problem with javascript?

Arty Effem
08-29-2010, 03:24 AM
<body onload="parent.myVar = capture_profile()">

If not already defined, myVar becomes a global variable in the parent document, containing the return value of capture_profile.
Remember that the wanted value may not become available immediately.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum