[Javascript] Thanks & follow-up, was: Handling child windowvisibility...
Hakan Magnusson (Backbase)
hakan at backbase.com
Thu Aug 12 10:54:33 CDT 2004
Try finding the window that the form opens through the name you specify
with target.
<form target="statWindow" onsubmit="if(statWindow)statWindow.focus();">
I'd be willing to bet Matts mortgage that this works.
Regards,
H
Matt Barton wrote:
> Since you're creating the window with form submission, I don't think there's
> anyway you can reference the resultant window in javascript in the original
> page. I'd love to be corrected, but to the best of my understanding it
> won't be possible.
>
> Your second suggestion might be feasible though: you could have an onClick
> event on the submit button which ran a routine which deactivated the button:
>
> <!-- start -->
> <input type="submit" name="mySubmitButton" value="Clicky"
> onClick="fDisableButton(this)">
> <script language="javascript">
> function fDisableButton (oButton) {
> // disable the button however you want here ... I'll hide it for
> now.
> oButton.style.display = 'none';
> }
> </script>
> <!-- end -->
>
> However, you'd then be left with the question of how to make the button
> active again...
>
> I'm not sure I'd approach the whole thing with a page submission in the
> first place: it'd be easier to handle if the window was opened via
> javascript - you then have a scripting relationship between parent and child
> windows and can manipulate one from the other as you see fit...
>
> Not much help I'm afraid ...
>
> Matt
>
> ----- Original Message -----
> From: "Shawn Milo" <ShawnMilo at runbox.com>
> To: <javascript at LaTech.edu>
> Sent: Thursday, August 12, 2004 4:23 PM
> Subject: Re: [Javascript] Thanks & follow-up, was: Handling child
> windowvisibility...
>
>
> Paul, Mat, and Hakan,
>
> Thanks for the advice. The following did the trick:
> <body onload="window.focus();">
>
> I do not want to force the window to remain on top,
> so I will not be scripting the onblur event.
>
> Follow-up question: Although this works, it does not
> bring up the window until the page has loaded (obviously),
> and since the page is running some ASP code and reading
> from a database, it could take a few seconds. In that time,
> the person could click the button again, thus re-starting
> the entire process.
>
> So is there a way to, from JavaScript included on the main
> page, bring that window to the fore? If not, I suppose that
> I could always disable the button temporarily, and replace
> the button value with 'Please Wait'. Ideas?
>
> T Herman,
>
> That is a very useful-looking script. However, I can't
> use it here, because the new window is being opened
> by a form submission, not by a JavaScript event.
>
> Thank, all!
>
> Shawn
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
More information about the Javascript
mailing list