Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 30th, 2006, 07:03 AM
Registered User
 
Join Date: Mar 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ganzy_ledzep26
Default How to pass value between 2 pop up screens ?

Can you please tell em how to pass values from parent pop-up screen to child pop-up screen and then send back a modified value back to the parent pop-up screen, such that the value is reflected in the parent pop-up screen?


 
Old March 30th, 2006, 08:41 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii ganzy_ledzep26!!

Not only you can get popup(child) window "form field values",but also you can get javascript "variable values" to/from parent window.


Plz find the code
****mainpage.html*********
<script>
var i

var mywindow
mywindow=null
function opentwowindow()
{
mywindow=window.open("mywin.html","null","scrollba rs=yes,resizable=yes,width=300,height=340,left=100 ,top=100")
i=100
}

function getchildfirstname()
{

firstname=mywindow.document.myform.fname.value
valueofi=mywindow.i
alert("Child firstname"+firstname)
alert("Child value of i "+valueofi)

}

</script>
<form name="myform">
<input type=text name="fname" >

<input type=button value="getchildfirstname" onclick="getchildfirstname()">
<input type=button onclick="opentwowindow()" value="openpopup">
</form>

*************mywin.html*************
<script>
var i

function getparentfirstname()
{
 i=99
firstname=window.opener.document.myform.fname.valu e
valueofi=window.opener.i
alert("Parentfirstname"+firstname)
alert("Parent value of i "+valueofi)
}

</script>
this is poupup window
<form name="myform">
<input type=text name="fname" >

<input type=button value="getparentfirstname" onclick="getparentfirstname()">

</form>
*************
hope this will help you

Cheers :)

vinod





Similar Threads
Thread Thread Starter Forum Replies Last Post
open a new pop-up from a pop-up crmpicco Javascript How-To 1 January 18th, 2005 10:48 AM
Customizing MSI Setup screens debsoft General .NET 1 June 4th, 2004 01:26 AM
Customizing Installation Screens debsoft General .NET 0 May 26th, 2004 06:58 AM
Refresh Client Screens BSkelding ASP.NET 1.0 and 1.1 Basics 3 May 13th, 2004 01:11 PM
Dual Screens Louisa Beginning VB 6 1 November 9th, 2003 05:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.