OEMike has asked for the wisdom of the Perl Monks concerning the following question:

Help : I have the following scenerio: HTML -> Hotlink calls CGI Script which does some preprocessing and then write's a dynamic HTML call via a Java script Window.Open(). Then a form is displayed. Problem #1, when I call the CGI script, the parent window disappears (goes white) - I believe that is due to the Print "Content/TYPE HTML \n\n" (etc.. yeah I know not exactly correct). How can I get around that. Secondly, after the form is filled out and submitted, a second cgi process handles the form and calls Window.close (), but I can not figure out after the window close, how to refress the parent window. Any suggestions?! Michael Thank you - OEMike

Replies are listed 'Best First'.
Re: PERL, JAVA and HTML
by BrowserUk (Patriarch) on Aug 07, 2002 at 23:15 UTC

    The following js (with apologies) snippet, will open a new window from a standard <a href=...></a> (and should work with the button thing you describe) and leave (or rather return) the existing window to the place it started without requiring the multi-levels of indirection you are currently using. I have tested this with my two available browsers, Opera 6 and IE 5.5...the rest is up to you.

    <html> <body> <a href= "javascript:window.open( 'test.htm','_blank', 'width=100, hei +ght=100');history(-1);"> test </a> </body> </html>
Re: PERL, JAVA and HTML
by OEMike (Novice) on Aug 07, 2002 at 19:20 UTC
    Here is an example:
    (HTML) <a href="www.example.com/cgi-bin/openwindow.cgi"> ...User clicks link and starts CGI below (CGI) - Open Window ...basic PERL header stuff here.. print "Content-type: text/html\n\n"; print <<HMTL <scirpt> window.open('security_modify_information.htm' ,'mywindow','width=400,height=550,left=30 </script> JAVA (HTML - Security_modify_information.htm) This is a form, upon submit, it checks the form fields and upon comple +tion, it does the following: <script> window.close (); </script>
    The first CGI - which is opened as a child window, opens but the parent get's cleared. Then when the submit is completed, the parent neeeds to be reloaded. Hope that clears things up.
      Why don't you simply have your link in the parent window open a new window which loads your CGI script? That should preserve the contents of the parent window.
        The Href is actually a FPHOVER button that accepts a URL PARM, so you can only call a CGI or HTM script from it, not a Window.open java command.. Thank you - OEMike