Help with popup

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I am loading a popup from my parent page when an image is clicked. How can I
now pass a value from a textbox to the popup page. Currently this is how I am
calling the popup from parent page

<A href="javascript:GetInfo(txtRetVal', true)"><IMG height="16"
src="images/lookup.gif" width="16" align="middle" border="0"></A>

txtRetVal is the name of the textbox on the parent page that accepts the
value returned from the popup.

Thanks
 
Or you might call the opener window. We've included small sample code, one
containing some code from a default.htm page, the other one should be saved
in 'open.htm'. The javascript from open.htm calls the opener page. Hth.

Kind regards,
Nikander & Margriet Bruggeman

Default.htm:

<html>
<head>
<script>
var strGlobal = "test1";

function SayHi()
{
return "Hello!";
}

function ChangeGlobal()
{
strGlobal = "aaa";
}
</script>
</head>
<body>


<a href="#" onClick="window.open('open.htm', 'myWin','toolbar=no,
directories=no, location=no, status=yes, menubar=no, resizable=no,
scrollbars=no, width=300, height=200'); return false">
Open</A>

<a href="javascript:ChangeGlobal()">Change</a>

</body>
</html>

Open.htm:

<html>
<body>

Open

<script>
alert(window.opener);
alert(window.opener.strGlobal);
</script>

</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top