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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    simultaneous close window redirect parent

    hello,

    I'm having a hard time combining functions. I wish to have one button which will do both:

    close a popup window (basically an 'agree' page) and
    redirect the parent window to a desired URL


    I've tried several iterations of things, but continue to get poor behavior. The parent redirect works, but the popup does not close. For instance,

    <SCRIPT Language="javascript" type="text/javascript">
    <!-- close this window and change parent window to new URL

    newWindow = null

    function updateParent(newURL) {
    opener.document.location = newURL;
    if (newWindow && !newWindow.closed) {
    newWindow.close()
    }
    }

    // end hiding script -->
    </script>



    Within the body of my page, I attempt to

    <form>
    <input type=button value="I Agree" onClick="updateParent('thumbnails.htm?c=cool&y=yes')">
    </form>

    It should be obvious to me, but it isn't. Any help would be wonderful.

    confounded.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <input type=button value="I Agree" onClick="updateParent('thumbnails.htm?c=cool&y=yes');window.close();">
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #3
    New to the CF scene
    Join Date
    Sep 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks Roy,

    That was the trick!


  •  

    Posting Permissions

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