SPUG: Re: Closing a window from perl
jcokos at ccs.net
Tue Jul 11 19:32:16 CDT 2000
Do you want to nuke the window as soon as they hit
the submit button, or do you want your .cgi program
to do it's magic, and then nuke the window after it finishes?
If you want to nuke the window immediately on submit,
then you'll likely have some problems, as your program
needs a place to exit....but here's how you'd do it:
<FORM NAME="whatever" ACTION="/path/to/program.cgi" onSubmit="self.close()">
A more elegant way is to have the form submit to your .cgi
and have your cgi send this as it's response:
print "Content-Type: text/html\n\n";
You could, of course make the return not simply close the window,
automatically as that example does, but instead give the user
a button to hit (so that they know your .cgi did it's thing)
John Cokos, President / CEO: iWeb Inc.
jcokos at ccs.net
----- Original Message -----
From: "Richard Wood" <wildwood_players at yahoo.com>
To: <spug-list at pm.org>
Sent: Tuesday, July 11, 2000 4:35 PM
Subject: SPUG: Closing a window from perl
> Hi everyone,
> I have a web page of database column names. When you
> function is called to open a new window and a perl
> script is invoked to fill it.
> The perl script defines a frameset and then re-invokes
> itself to fill the frame.
> On the second pass through, the definition for the
> column is retrieved from a file, put into a textarea
> form field, a submit button is put on the page and the
> whole thing is displayed quite nicely. In this way,
> the user can update the definition if they know a
> better one.
> Now my question. How do I get rid of the dialog if
> the user updates the text and presses the submit
> button? I get the text back into the perl program but
> I can't figure out (or find documentation on) how to
> tell the dialog to go away. I figure I must have to
> send some sort of HTTP response header to say,
> "Thank-you very much but we won't be needing you
> anymore", but how do you do that?
> Rich Wood
> Richard O. Wood
> Wildwood IT Consultants, Inc.
> wildwood_players at yahoo.com
> Do You Yahoo!?
> Get Yahoo! Mail - Free email you can access from anywhere!
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
> Subscriptions; Email to majordomo at pm.org: ACTION LIST EMAIL
> Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
> For full traffic, use spug-list for LIST ; otherwise use spug-list-digest
> Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Subscriptions; Email to majordomo at pm.org: ACTION LIST EMAIL
Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
For full traffic, use spug-list for LIST ; otherwise use spug-list-digest
Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
More information about the spug-list