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

grabbing a variable from a popup after submitting

Status
Not open for further replies.

diezy

Technical User
Sep 2, 2002
50
CA
hey,

i have a webpage with a form on it. on that form i have a link to a popup window that has a "add new member" form. however once the user fills in the popup form and submits it i want to grab the first name field from the popup)"add new member" form and pass it my original form (the parent form)


 
i know this is completely wrong....but it is something along what i am trying to do.


index1.html *********************************
<SCRIPT LANGUAGE="JavaScript"><!--
function myOpen(url) {
window.open(url,'popupwindow','width=300,height=300');

}
//--></SCRIPT>

<A HREF="javascript:myOpen('index2.html')">Open window</A>

<form method=post action="">
<input type="text" name="test">
</form>
**********************************************

index2.html (POPUP WINDOW)*****************************

<SCRIPT LANGUAGE="JavaScript"><!--
var x;
x = document.form2.first_name.value;
opener.popupwindow.document.form1.test.value = x;

//--></SCRIPT>
</head>

<body>
<form method=post action="">
<input type="text" name="first_name" value="bobby">
</form>
</body>
************************************************
 
ingore my previous msg.

this is much simpilier to read.

index1.html **********************************
<SCRIPT LANGUAGE="JavaScript"><!--
function myOpen(url) {
myWindowHandle = window.open(url,'windowname','width=300,height=300');

}
//--></SCRIPT>

<A HREF="javascript:myOpen('index2.html')">Open window</A>

<form method=post name="form1" id="form1">
<input type="text" id="test" name="test">
</form>

******************************

index2.html***************************************

<form method=post action="">
<input type="text" name="first_name" value="hello">
<a href="#" onclick="opener.location.form1.test.value='hello'; window.close(); return false;">Close Me</a>
</form>

****************************************************
 
nevermind...i figured it out

thanks for the help though
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top