Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

iframe opener 1

Status
Not open for further replies.

dexeloper

Programmer
Joined
Oct 26, 2004
Messages
162
Location
GB
I'm trying to reference values in the opening window but having no joy. Two files:

<html>
<head>
</head>
<body>
<form name="main">
<iframe src="test02.html">ghgh gh</iframe>
<input type=hidden name="a1" id="a1">
</form>
</body.
</html>

<html>
<head>
<script language = "JavaScript">
function doX(){
opener.document.forms["main"].a1.value = "gg";
window.opener.getElementById("a1").value = "gg";
}
</script>
</head>
<body>
<input type=button value="click" onclick="doX();">
</body.
</html>

Both methods of setting the value of a1 fail. Any ideas?
 
iframes (as well as regular frames) do not reference the calling page via opener, they reference the calling page from parent, try that out instead.

-kaht

[small] <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]
[banghead] [small](He's back)[/small]
 
kaht - you're a star and will go to heaven.

 
kaht - you're a [purple]star[/purple] and will go to heaven.
Thanks for the kind words. And..... since you mentioned it first, taking a quick look at your profile is showing the far right column looking a little bare. Stars around here are best when they're the purple variety, and often make posters jump at the chance to assist you when they are given graciously. [wink]

-kaht

[small] <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]
[banghead] [small](He's back)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top