[Javascript] Thanks & follow-up,

Shawn Milo ShawnMilo at runbox.com
Thu Aug 12 12:06:27 CDT 2004


I'm pretty sure you are right.  I've come up with a scheme that I think will do the trick.  I'm going to disable the button, then let JS in the *new* window reach into the parent and re-enable the button.  I'll post code when it's working.  I'm about 80% there, but I haven't quite figured out the syntax to access the form on the parent  (window.parent.main.document.forms or something like that).

Shawn

> 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
> 
> -- 
> This email has been verified as Virus free
> Virus Protection and more available at http://www.plus.net
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 
> 



More information about the Javascript mailing list