Click to See Complete Forum and Search --> : How to get back to previous window ?


DaveinLondon
09-01-2006, 03:57 PM
Hi all.

My script launches a new window when the link is clicked.

In that new window is a form that then calls another script. But I want to run that script in the parent window. How do I do that ?

This is my form ( in the child window):


<form name="detail" action ="<?php echo "$delete_link" ?>" method = 'POST'>
<td style="vertical-align:center; height:30px;">
<input type="hidden" name="ad_ref" value= "<?php echo "$ad_ref"; ?>" >
<input type="hidden" name="section" value= "<?php echo "$section"; ?>" >
<input type="hidden" name="x_detail" value= "<?php echo "$N_detail"; ?>" >
<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="TEXT" name="x_reason" value = "enter reason"
size = '40' maxlength='200' />
</td>
</tr>
<tr>
<td>
<input type="submit" class="btn_wide1" value = "Delete Advert and send Email."
onMouseover="this.style.backgroundColor='#66ccff'"
onMouseout="this.style.backgroundColor='#ccffff'" >
</td>
</form>


Thanks very much for your help. :)

dave

bokeh
09-01-2006, 04:25 PM
Well it's a Javascript question so you may get a better answer in that forum. Off the top of my head I would write the form to a div on the parent using opener.document syntax. Then have the child auto submit that form and close itself.

You may even be able to do it with something similar to the target attribute.

NogDog
09-01-2006, 04:26 PM
Well, PHP is running on the server and thus has no idea what window the client is running in, so you'll have to find some sort of client-side solution: either HTML or JavaScript.

EDIT: I guess Bokeh clicked Submit while I was typing. :)