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
    Senior Coder
    Join Date
    May 2006
    Posts
    1,673
    Thanks
    28
    Thanked 4 Times in 4 Posts

    I've got this far .. can you help me out please ?

    I am working on this for my website - but am stuck!
    - please help if you can.

    On hitting a link a new window opens.
    I then run a script in it and then have a form.

    The form is supposed to close that child window and bring me back to the parent / opener window and run a script in it.


    I put this in the parent / opener window:



    Code:
    <head>
    <script type="text/javascript">
    <!--
    window.name = "oldwin";
    // -->
    </script>
    </head>
    <body>
    and then this is the link that opens the child window:

    Code:
    <a href='$Ad_detail' target='_blank' onclick=\"window.open (this.href, '$Ad_detail', 'height=800,width=960,scrollbars'); return false\" ><b> $Dtype </b></a>
    In the child window:
    a script runs and shows a form.
    my form (in child window) now says this:



    Code:
    <div style='width:400px;position:absolute;left:600px; top:600px;' >
    <form name="suspended" action ="a_run_top.php" method = 'POST' target="oldwin" onsubmit="this.close() window.oldwin.focus();">
    <input type="hidden" name="del_ctl" value= "Y" >
    <input type="hidden" name="section" value= "<?php echo "$section"; ?>" >
    <input type="hidden" name="x_yct" value= "<?php echo "$N_yct"; ?>" >
    <input type="hidden" name="x_yct_op" value= "<?php echo "$N_yct_op"; ?>" 
    
    <input type="submit" class="btn2"  value = "Continue"
    onMouseover="this.style.backgroundColor='green'" 
    onMouseout="this.style.backgroundColor='#ccffff'" >
    </form>
    </div>

    But the result is that the script (a_run_top.php) runs in the child window - not in the parent window as I wanted.

    I am trying to get the child window closed and the script to run in the parent / opener window.

    Any more ideas / corrections ?

    Thanks for help.
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Hmm what you might have to is have the form on the opener page and pass the values created by a_run_top.php back to the opener form.
    Code:
    opener.document.forms['suspended'].submit();window.close();return false;
    inside of your onsubmit rather than what you have there now.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Senior Coder
    Join Date
    May 2006
    Posts
    1,673
    Thanks
    28
    Thanked 4 Times in 4 Posts
    Thanks -
    yer - I was trying for an easier approach but passing from form to form seems the only way - cheers.
    (done it)
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.


  •  

    Posting Permissions

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