Solved

Closing window after successful data processing

Posted on 2001-07-24
6
217 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

839 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