Solved

Dismissing a window.

Posted on 2000-05-03
2
177 Views
Last Modified: 2010-04-09
I have a page that contains a javascript function to open a window containing a form. What I'd like to have happen is when the user clicks the submit button the window goes away and the cgi activated by the form reports its output to the main window (where the function was initially called from).

I tried using the onSubmit event to call window close.  

  w.document.write("<FORM METHOD='POST' ACTION='cgi6.exe' onSubmit='w.close();return true'>")

But this doesn't work. The out put from cgi6 gets written to the main browser window.

Is this possible?
0
Comment
Question by:winkle
[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
  • 2
2 Comments
 
LVL 33

Accepted Solution

by:
knightEknight earned 100 total points
ID: 2774834
You simply need to specify the target of the main window in your form:

  w.document.write("<FORM TARGET='NameOfTheMainWindow' METHOD='POST' ACTION='cgi6.exe' onSubmit='setTimeout(\"w.close()\",500);return true'>") ;

also, note the setTimeout for the w.close()
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 2774846
Also, you can set the name of the main window like this:

  self.name="NameOfTheMainWindow";

(obviously, this needs to be executed in the main window)
0

Featured Post

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!

Question has a verified solution.

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

Suggested Solutions

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

752 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