Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2003
    Location
    Cape Town
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Pop up window closure

    POP UP WINDOW CLOSURE PROBLEM

    I'm using code to open a small pop up window which has a form. Once submit is pressed I want the window to close. I'm using code from a Pop Up Window tutorial but it does not work. I get a 500 error message "internal server problem" in the pop up window. I'm using Matt's Formmail.pl (renamed) and I get the email so that is working.

    Your help would be appreciated.

    I've included the code below. I'm a designer so I know very little about coding.

    CODE TO OPEN POP UP WINDOW

    <a href="Library/medical_insurance_files/contactform.htm" target="NewWindow" onclick="window.open('medical_insurance_files/contactform.htm','newWindow','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,res izable=0,width=320,height=250');return false">Barry
    P Fletcher & Associates</a>


    CODE IN THE POP UP WINDOW

    <form method="post" action="/cgi-bin/contactmail.pl" name="Medical Insurance Contact Form" onClick="return targetopener(this,true,true)">
    <input type=hidden name="required" value="realname,email">
    <input type=hidden name="print_config" value="realname,email">

    <script language=javascript>
    <!--
    var username = "james";
    var hostname = "ripplewebs.com";
    var linktext = username + "@" + hostname;
    var theinput ("<input type=hidden name=recipient value=" +username + "@" + hostname" + ">";
    document.write(theinput);
    //-->
    </script>

    James

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Closing a window which you opened is as simple as

    self.close()


    a 500 error is nothing to do with javascript, it's a server error; there's something going wrong with the mail script, or with the way you're addressing it


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •