Solved

Closing window after successful data processing

Posted on 2001-07-24
6
223 Views
Last Modified: 2008-02-20
Hi all,

At some point I open new window (window.open) for user to fill in some fields. When form submits data is proccessed by some asp. Is there a way I can close that window and return back to "opener" on successful data processing?
I guess this should be somehow done by processing asp?

-hpet
0
Comment
Question by:hpet
6 Comments
 
LVL 8

Accepted Solution

by:
drittich earned 100 total points
ID: 6313992
Use a function that does the submit, then closes the window, e.g.

<script language="javascript">
  function DoSubmit() {
    document.YourForm.submit();
    self.close();
  }
</script>

<form name="YourForm" onSubmit="DoSubmit()">
...
</form>
0
 
LVL 5

Expert Comment

by:raizon
ID: 6313993
Try this

<%

ASP to process the data.

strClose = "onLoad=window.close();"

%>

<body <%= strClose %>>
0
 

Expert Comment

by:cscheepers
ID: 6316154
There are two ways.

1. In the asp page that updates the database - at the end use a page redirect:

<%Response.Redirect("page.asp")%>

2. In the asp page, you can close it with jscript below your asp:

<Html>
<Head>
<Script language="JavaScript">
  window.close();
</Script>
</Head>
<Body>
</Body>
</Html>

Hope it helped.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:anupkarade
ID: 6316255
<!-- Your submit Page-->

<%
'' Collect all the data here....
'' Perform insert /update / delete operation
   response.redirect("PreviousPage.asp")    
%>

this is better idea ..I agree with csheepers there is no need to go for javascript..

the best part is that you can even send message in query
string regarding success or faliure of operation and
print it in the previous page...

regards
Anup
0
 
LVL 33

Expert Comment

by:hongjun
ID: 8623303
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
[points to drittich]

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

hongjun
EE Cleanup Volunteer
0
 

Expert Comment

by:Chmod
ID: 8674372
As recommended

Chmod
Community Support Moderator @Experts Exchange
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question