...

View Full Version : How do I get back to my parent window ?



jeddi
09-01-2006, 10:59 PM
Hi all.

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

<td class="ad_top_row"><a href='$Ad_detail' target='_blank' onclick=\"window.open (this.href, '$Ad_detail', 'height=800,width=960,scrollbars'); return false\" ><b>$event</b></a></td>

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

This is my form ( in the child window):



<form name="detail" action = "do_it.php" 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

jeddi
09-02-2006, 10:19 AM
Please help!

I am really stuck with this one - Im just going in circles! :confused:

jeddi
09-03-2006, 12:48 PM
So no-one knows ?

Ahh well - off to Webdeveloper forum then !

I need to find the answer !!

probey20
09-07-2006, 05:15 PM
In the child window, you should be able to target the parent window (or even a form in the parent window) like this:


<script language="JavaScript">
<!--
myParentFunction(window.opener.parentForm);
-->
</script>

And then the myParentFunction could be contained in your parent window and would be called from the child window. Is that what you're needing?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum