3 members and 65 guests
Most users ever online was 695, 02-16-2011 at 07:01 AM.
» Site Navigation
» Domains For Sale
|
-
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.
-
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.
-
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.
-
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.
Similar Threads
-
By jfoley in forum Flash / Multimedia
Replies: 2
Last Post: 08-23-2007, 11:32 AM
-
By Uncle Cake in forum Javascript / AJAX / VBScript
Replies: 1
Last Post: 06-12-2006, 10:17 PM
-
By Effector 13 in forum Javascript / AJAX / VBScript
Replies: 4
Last Post: 08-07-2003, 10:22 PM
-
By marklaz in forum Javascript / AJAX / VBScript
Replies: 1
Last Post: 06-02-2002, 03:14 PM
-
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
-
Forum Rules
|