[SOLVED] - Automatically sending values to Iframe
Posted: Thu May 19, 2005 12:38 am
pageA.html
pageB.html
When you click the button the msg box appears with th value from pageA.
But I want this without the click button - automatically. The commented line (Line
when uncommented - doesn't seem to work - error:
Error: parent.frames.iframe1.Fill is not a function
Yet it works when you click the button. Anyway to get this work automatically ? It seems the IFRAMe gets loaded only after the parent page gets loaded.
Thanks
Code: Select all
<html>
<head></head>
<body>
<input type="e;button"e; value="e;Click"e; onclick="e;SendValue()"e; /><br/>
<iframe name="e;iframe1"e; src="e;pageB.html"e;></iframe>
<script type="e;text/javascript"e;>
var result = "e;test"e;;
//document.onload = parent.framesї'iframe1'].Fill(result);
function SendValue()
{
parent.framesї'iframe1'].Fill(result);
}
</script>
</body>
</html>Code: Select all
<html>
<head>
<script type="e;text/javascript"e;>
function Fill(somevalue)
{
alert(somevalue);
document.getElementById("e;id1"e;).value = somevalue;
}
</script>
</head>
<body>
<form id="e;frm"e; action="e;test.php"e; method="e;post"e;>
<input type="e;hidden"e; name="e;name1"e; id="e;id1"e; />
</form>
</body>
</html>But I want this without the click button - automatically. The commented line (Line
Error: parent.frames.iframe1.Fill is not a function
Yet it works when you click the button. Anyway to get this work automatically ? It seems the IFRAMe gets loaded only after the parent page gets loaded.
Thanks