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

POP UP WINDOW RETURN VALUES

Status
Not open for further replies.

marknav

Programmer
Sep 26, 2002
14
US
In window "x" I want to open a pop up window "Y" that provides a list of values. when the user choose two of the values(by clicking a button next to them) window "x" will be closed and the values will be placed in the window "Y" inside text boxes.
What exactly the scrupt I should use in each of the windows?
Thank you
 
this is the main html page
<HTML>
<HEAD>
<TITLE>Main Window</TITLE>
</HEAD>
<script language=&quot;javascript&quot;>
var newwindow;
function Click(url)
{

newwin=window.open(url,&quot;name1&quot;,'scrollbars=yes,HEIGHT=300,WIDTH=400,resizable=no,status=yes');
}

</script>

<BODY>
<form name=&quot;mainform&quot;>
<input type=&quot;Text&quot; id=&quot;txtmain&quot; value=&quot;Main Html&quot;>

<input type=&quot;Button&quot; onClick=&quot;javascript:Click('sub.html');&quot; value=&quot;Click Me&quot;>


</form>
</BODY>
</HTML>


this is the sub page

<HTML>
<HEAD>
<TITLE>sub Window</TITLE>
</HEAD>
<script language=&quot;javascript&quot;>

function Click()
{
self.opener.document.mainform.txtmain.value=&quot;Subhtml&quot;;
window.close();
}

</script>

<BODY>
<form>
<input type=&quot;Button&quot; onClick=&quot;javascript:Click();&quot; value=&quot;Sub Click Me&quot;>
</form>
</BODY>
</HTML>

make a two html pages on desktop one as main.html and one as sub.html copy first code in main and next one in sub. run the main.html

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top