HTML Help
HTML Help Central . com

» Online Users: 143

0 members and 143 guests
No Members online
Most users ever online was 695, 02-16-2011 at 07:01 AM.

» Site Navigation

 > FAQ

» Domains For Sale

Results 1 to 4 of 4
  1. #1
    alan_every Guest

    Unhappy pop-ups, cgi and window control

    Description of what I want to work:

    1. Parent window runs javascript to open child window (pop-up)
    2. Child window (on selection of submit) runs cgi script, reloads parent window, then closes itself.

    The problem I encounter is that unless I add an alert into the child window javascript the script fails to run the cgi script.

    Small bits of child script follow:

    <form name="softloginform" action="/cgi-bin/promo.cgi" method="post">

    <input type="button" name="user" value="yes" onClick="chosenyes()">
    .......
    ......

    function chosenyes() {
    document.softloginform.submit();
    opener.location.reload();

    alert("hmmmmmm strange");

    self.close();
    }

    If I add the alert as shown... the script works fine. If I remove the script the submit() statement fails to run. It displays no errors on the js console thingy.

    I presume it is a handle type fault with the child going out of focus... but has anyone any idea on this problem / cure.

  2. #2
    Join Date
    Feb 2001
    Location
    Toronto Canada,
    Posts
    4,777

    top.window.close('submit');

    I figure the reason for the is because its not getting a chance to submit, & if you ad the alert(); they must ok it, giving the cgi a few seconds to submit, your best bet is not to forward the person to another page in your parent window, & onload close that window, this way you know the information has been sent.

    --------------------------------------------------------------------------------------------------------
    Free Wordpress Code snippets for your blog
    wpsnipp.com - visit us now!

  3. #3
    alan_every Guest

    Angry I'm stuck by spec. requirements..

    Sadly I'm stuck by spec requirements to push up a pop-up box (the child window).

    From further investigation it does appear to be as stated by previous thread. The cgi script does not have time to finish before child dies.

    Is there any possible way of holding control until cgi finishes?

    A sleep type command would not be possible as it will depend too much on download time.

  4. #4
    Join Date
    Feb 2001
    Location
    Toronto Canada,
    Posts
    4,777
    Well that would be fine if every time the connection would be the same if so I would just set the close cmmnd on a timer, & test it out a few times, eg:
    PHP Code:
    function chosenyes() { 
    document.softloginform.submit(); 
    opener.location.reload(); 


    call_self_close_function(); 


    & then just create a timer,

    But really the best thing have your CGI forward the page to a new one once done, then close the window,but add focus to your popup to keep it on top. why can't you do that ? it would be like that same thing.

    --------------------------------------------------------------------------------------------------------
    Free Wordpress Code snippets for your blog
    wpsnipp.com - visit us now!

Similar Threads

  1. Pop up window control
    By jfoley in forum Flash / Multimedia
    Replies: 2
    Last Post: 08-23-2007, 11:32 AM
  2. Replies: 1
    Last Post: 06-12-2006, 10:17 PM
  3. HELP!? : open.window useed in a window opened by open.window NOT WORKING?!!
    By Effector 13 in forum Javascript / AJAX / VBScript
    Replies: 4
    Last Post: 08-07-2003, 10:22 PM
  4. opening a open link in parent window from child window
    By marklaz in forum Javascript / AJAX / VBScript
    Replies: 1
    Last Post: 06-02-2002, 03:14 PM
  5. Javascript Window COntrol
    By mrsmith in forum Javascript / AJAX / VBScript
    Replies: 3
    Last Post: 12-20-2001, 03:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBadvanced CMPS v4.1.1