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
|