Solved

Closing window after successful data processing

Posted on 2001-07-24
6
211 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now