Solved

Closing window after successful data processing

Posted on 2001-07-24
6
226 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 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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

Suggested Solutions

Title # Comments Views Activity
Select only the top record in a left join 13 50
Index on a Table 6 37
Adding 1 the value of input "text" every 3 seconds 5 48
P3P validator , ASP, PHP ,Https and Http links 3 43
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…
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/…
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…

739 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