#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    5
    Rep Power
    0
    Hi

    I've got a small problem. On my site there's a news section (window 1) and people can react to the news. A small window (windows 2) with a form will popup. After submitting the form I want to close the small window and refresh the NewsWindow (window 1) contents.

    I know i have to use the header funtion but how can I close the window?

    thanx in advance
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Indonesia
    Posts
    87
    Rep Power
    15
    Just simply use JavaScript to close the window.

    <script>
    function validateForm(form)
    {
    some validation ...
    window.close();
    }
    </script>

    <form action="process.php3" method="post" onsubmit="return validateForm(this)">

    </form>

    See ya


    ------------------
    CyberOsc
    sphmjf_oscario@gurlmail.com

    ** It's the world of Oscario **
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    5
    Rep Power
    0
    thanx CyberOsc
    but I've already used this one
    <script>
    if (parent.window.opener.closed)
    {
    window.open("http://");
    }
    else
    {
    parent.window.opener.location = "http://";
    }
    window.close();

    </script>
    </head>

Similar Threads

  1. Uploading Files
    By vivekjain in forum ASP Programming
    Replies: 0
    Last Post: February 16th, 2004, 11:21 PM
  2. Header redirect function not working after host switch
    By Jhorra in forum PHP Development
    Replies: 5
    Last Post: January 26th, 2004, 10:28 AM
  3. post data to new window then do redirect
    By theDano in forum PHP Development
    Replies: 2
    Last Post: January 24th, 2004, 06:08 PM
  4. php redirect without using header?
    By mickeyren in forum PHP Development
    Replies: 4
    Last Post: January 14th, 2004, 07:00 PM
  5. Upon Closing the window call session_destroy function ?
    By murugesan in forum PHP Development
    Replies: 2
    Last Post: January 12th, 2004, 04:53 AM

IMN logo majestic logo threadwatch logo seochat tools logo