|
-
Jun 20th, 2000, 09:23 PM
#1
Thread Starter
Member
Hello
In my ASP application I open a new window with command
<SCRIPT>
window2=window.open("xx.asp","secondwindow")
</SCRIPT>
Can anybody know how to close window2 and navigate back to main window (run an ASP in main window) using submit button in window2.
I tried:
<FORM action="osp.asp">
<INPUT type="SUBMIT" name="action" value="Close" onClick="window.close();window.opener.focus">
</FORM>
Window2 closes but osp.asp is not executed in main window.
Best regards,
Tomaz
-
Jun 21st, 2000, 03:25 PM
#2
Frenzied Member
Just a guess here, but have you tried specifying a target tag in the form
<FORM action="osp.asp" target="window1">
I'll have a play with this later if I get time.
-
Jun 21st, 2000, 03:57 PM
#3
Thread Starter
Member
switching between windows
I tried
<FORM action="osp.asp" target="window1">
but it opens another browser instance.
"window1 " is default window adn is not opened by javascript
window.open().
I also tried
<FORM action="osp.asp" target="window.opener">
but it opens another browser instance too.
Best regards,
Tomaz
-
Jun 21st, 2000, 05:46 PM
#4
Frenzied Member
Here you are tompod
load default.htm into your browser...
default.htm
Code:
<html>
<frameset cols="*">
<frame name="main" src="osp.asp">
</frameset>
<noframes>
<p>This page uses frames, but your browser doesn't support them.</p>
</font></body>
</html>
osp.asp
Code:
<%@ Language=VBScript %>
<HTML>
<HEAD>
<SCRIPT language='Javascript'>
function OpenPopup(){
window2=window.open('xx.asp','secondwindow','width=200,height=260')
}
</SCRIPT>
</HEAD>
<BODY>
<%
dim x
dim y
x = clng(Request("x"))
y = clng(Request("y"))
Response.Write "X+Y = " & x + y
Response.Write"<BR><input type=button value='Next' onClick='OpenPopup()'>"
%>
</BODY>
</HTML>
xx.asp
Code:
<%@ Language=VBScript %>
<HTML>
<HEAD>
</HEAD>
<BODY>
<FORM action="osp.asp" target="main">
<input name="x" value=2>
<input name="y" value=2>
<INPUT type="SUBMIT" name="action" value="Close" onClick="window.close();window.opener.focus">
</FORM>
<P> </P>
</BODY>
</HTML>
-
Jun 21st, 2000, 07:52 PM
#5
Thread Starter
Member
switching ..
Thank's Mark!
I works fine, but there is just one thing. I'm calling this asp from frame page with two frames
--------------------------
<html>
<frameset framespacing="2" rows="50%,50%" frameborder="1">
<frame name="main1" src="yy.asp">
<frame name="main2" src="osp.asp">
</frameset>
<noframes>
<p>This page uses frames, but your browser doesn't support them.</p>
</font></body>
</html>
----------------------------
I'n this case
----------------------------
<INPUT type="SUBMIT" name="action" value="Close" onClick="window.close();window.opener.focus">
----------------------------
stil opens another browser instance, instead of
display osp.asp in main window.
If you know how to fix that I vould be very pleased.
Thanks and best regards,
Tomaz
-
Jun 21st, 2000, 08:03 PM
#6
Frenzied Member
do you want osp.asp to
a)reload into the bottom frame or
b)reload and replace both frames?
if a) then it works OK (for me)just make sure you've got main2 as the target
if b), you'll need another frame page with one frame with the SRC set to the 2-frame frame page....
-
Jun 21st, 2000, 08:11 PM
#7
Thread Starter
Member
Thank's Mark
I've just forgot to specifie "main2" frame as a target.
Now it works fine.
You helped me a lot!
Thank's again!
Tomaz
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|