Jumping Between Windows
I've been working on a small e-commerce site with the Access DB and ASP. I have one variable to get from a form that I open in a separate window and bring back to the current form in the current window. I would like to keep the sections all in this current form and not break it into separate forms. Can anybody tell me how to bring data back to the open form?
I'll get this moved for you :)
See the following example. Use the 'opener' object to get to your initial window.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
var win = window.open('','','toolbar=yes,scrollbars=yes,width=200,height=300')
win.document.write('<html><body><input type="text" name="intext" id="intext"><br>');
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
<form name="myform" id="myform">
:) Thanks, I will give this a try.
I tried your code and could not get it to work. This is really driving me crazy. Any more help?
Can you be more specific... I tried the code and it works with ie5+ Be aware that this forum added an extra space between java and script in the code.
Thanks for writing back Doggi.
I've been working on this and got it all to work except:
win.document.write('<a href="java script:opener.document.forms.mytext.value=intext.value;this.close()">close</a>');
I am actually coding this into the remote window to put the value into the opener window. I had too much code in the window to switch. so my code really is:
to accomplish this. If I replace the reference on the right with a string it works. The string value comes into the opener input element and the remote window closes. I just can't understand why the reference to the radio input name (FeeNumber).value pair doesn't work (return a value). AUUGGHH!
Maybe I should look at another way to accomplish this task such as writing to a temporary database table?
if this doesn't work try figuring out if you can access the value of FeeNumber.value
As a suggestion add the following line in your code just to check whether you are even getting the vaue ...
You can remove the line once the code works ..
document.title = document.formname.FeeNumber.value;
Note: formname is name of your form in the PopUp Window.
:goof: Amit, thanks for the suggestion. I did try that and still could not get it to work. I have resorted to checking the radio buttons individually and using the array number to send back which choice number was selected. I am also looking at cookies and session level variables in ASP.
HELP! This is driving me crazy!!
Below is the jumping control structure I'm trying to make work
Dim Cook1, FeeNum, state, objRSfee, strSQLfee, Fee, FormName
response.write "var win=window.open('OrderFeeSchedule2001.html','orderfees','scrollbars=yes,toolbars=yes,width=616,height=300');"
'Dim Cook1, FeeNum, state
Cook1 = request.cookies
FeeNum = Left(cook1,2)
'Dim objRSfee, strSQLfee, Fee, FormName
strSQLfee = "SELECT * FROM fees WHERE form_number Like '" & FeeNum &"'"
set objRSfee = Server.CreateObject("ADODB.Recordset")
objRSfee.Open strSQLfee,objConn,adOpenStatic,adLockReadOnly, adCmdText
If objRSfee.EOF Then
Fee = ""
FormName = ""
Fee = objRSfee("form_cost")
FormName = objRSfee("form_name")
<%Response.Write " "&FormName%>