In article <40058f3e$0$70306$75868355@news.frii.net>,
javajonesk@hotmail.com enlightened us with...[color=blue]
> using another button to close the window would defeat the purpose of the
> script i'm trying to write.
>[/color]
Really?
*ahem*
It's for illustrative purposes.
The point is, it works. Making the var global was just fine.
You can close a popup from the opener. Where you put that statement is
up to you, but trying to put it before the popup loads will result in an
error.
[color=blue]
> here's a bit more detail about the specific problem i'm having and why i
> need this script: users are submitting a form and end up clicking the
> submit button multiple times or click on another submit out of
> frustration or impatience. i tried disabling all of the buttons on the
> page, spent 3 days on that, and decided to go with a "modal" pop up that
> would close after the parent page finished processing.
>[/color]
Is there some flaw in your application that having a user click on
submit more than once makes it crash?
Or is it just that the page then submits again and the user waits
longer, so you want a popup?
If the former, fix it.
If the latter, this isn't going to do you any good, since submitting a
page clears out the old page and references to the popup window are
lost.
Now, if the form is posted to a NEW window, thus keeping the old window
and code, you can close the popup when the form is done processing with
a little convoluted code in the window that the form posted to. But I
have a feeling that isn't what you're going for.
If your users are on the slow side, like mine, and have only recent DOM
browsers with javascript enabled, like mine, you can put the submit in a
wrapper, make a variable (init to false) that is set to true when the
submit button is clicked, then any time the button is clicked, checks
that variable to be false before submitting.
Note that this is not at all a good solution for general internet use.
Very, very bad for general use. Works like a charm for intranet apps and
other situations where you know your users and their browsers.
[color=blue]
>
> oh yeah, was this the corrected syntax:
> "var newWindow=null;"
>[/color]
No. Sorry, my bad - the syntax error was my fault when I took out that
unescape and didn't remove both parens.
--
--
~kaeli~
Who is General Failure and why is he reading my hard disk?
http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace