Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Closing window after successful data processing

Posted on 2001-07-24
6
Medium Priority
?
246 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 8

Accepted Solution

by:
drittich earned 400 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Industry Leaders: 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!

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

670 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