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