Re: targeting main window from popup
- From: "Hemanth" <hemanth.singamsetty@xxxxxxxxx>
- Date: 28 Oct 2005 11:12:16 -0700
Joshie Surber wrote:
> > What should I give in ???? for target?
>
> window.onload = function() {
> f = document.getElementById('myform');
> f.target = window.opener;
> }
>
......Thanks for your reply. How should I call this function in the
form??
> should work. If not, since I am assuming that the form just updates
> values somewhere that will affect how the main window is displayed, you
> may just use the popup as its own target, and after it is submitted
> output:
> window.onload = function() {
> window.opener.reload();
> window.close(); // optional
> }
......I tried something like this before. This what I did:
function update_parent()
{
window.opener.reload();
window.close();
}
<form name="myform" action="run.php" method="get"
onSubmit="javascript:update_parent()">
This runs the PHP script but displays the results in popup page (not in
opener and didn't close the popup window as expected). I'm using
Mozilla and IE browsers. I close the popup window manually and have to
"refresh" the main window to see the results in main window.
function update_parent2(url)
{
window.opener.location.href=url;
window.close();
}
<form name="myform" action="run.php" method="get"
onSubmit="javascript:update_parent2('run.php')">
The javascript works fine but doesn't actually run the PHP script as
expected. I mean, the "update_parent2" replaces the main window with
specified url and closes the popup window but the user (checkbox) input
in popup form is not being used.
Any more pointers would be helpful.
TIA
Hemanth
.
- Follow-Ups:
- FAQ update required (was: targeting main window from popup)
- From: Thomas 'PointedEars' Lahn
- FAQ update required (was: targeting main window from popup)
- References:
- Re: targeting main window from popup
- From: Joshie Surber
- Re: targeting main window from popup
- Prev by Date: Re: Status bar shows anchor href, not text I set in onmouseover
- Next by Date: Re: Easy Variable Scope question...
- Previous by thread: Re: targeting main window from popup
- Next by thread: FAQ update required (was: targeting main window from popup)
- Index(es):
Relevant Pages
|