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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suggestions to make this work in FF? 1

Status
Not open for further replies.

mopacfan

Programmer
Oct 30, 2000
190
US
This is my code that works in IE:
Code:
	window.opener.quoteinfo.drawingname.value = document.fileload.drawingfile.value;
But Mozilla does not like "window.opener"

Any suggestions?
 
if you are doing this in a direct popup, window.parent may work instead of window.opener

[monkey][snake] <.
 
parent refers mainly to frames - window.opener should work fine. This worked fine for me in both IE7 and FF2, click the button in test.html to open test2.html and it will alert the results of the hidden value in test.html:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<title>title test</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<script type="text/javascript"></script>
<style type="text/css"></style>
</head>
<body>

<input type="button" value="open new window" onclick="window.open('test2.html')" />
<input type="hidden" value="I'm a hidden value in the opener" id="test" />

</body>
</html>

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<title>title test</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<script type="text/javascript">

window.onload = function () {
   alert(window.opener.document.getElementById("test").value);
};

</script>
<style type="text/css"></style>
</head>
<body>

</body>
</html>

-kaht

Looking for a puppy? [small](Silky Terriers are hypoallergenic dogs that make great indoor pets due to their lack of shedding and small size)[/small]
 
It seems that adding "document" has solved the problem. Thanks.
 
[purple]You're welcome[/purple]

-kaht

Looking for a puppy? [small](Silky Terriers are hypoallergenic dogs that make great indoor pets due to their lack of shedding and small size)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top