By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,598 Members | 1,894 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,598 IT Pros & Developers. It's quick & easy.

How do I refresh target window?

P: n/a
hello all:

I have a pop up window is for the user to submit some information.
That window is refreched a few times with the user inputs (its a form
submit in itself... couple of times). I would like that window to close
after the user submits a rating and refreshed the original page that
opened the window.

I cant use opener.document.refresh because afterall the page isnt
considered the opener after the user posts the information on the pop
up window.

am i making any sense?

Oct 14 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a

si******@gmail.com wrote:
hello all:

I have a pop up window is for the user to submit some information.
That window is refreched a few times with the user inputs (its a form
submit in itself... couple of times). I would like that window to close
after the user submits a rating and refreshed the original page that
opened the window.

I cant use opener.document.refresh because afterall the page isnt
considered the opener after the user posts the information on the pop
up window.

am i making any sense?


Yes, but it is the same window, and it's the window that cares. At
least, in theory. :)

And it's reload, not refresh.

Give it a shot.

self.opener.document.reload(true);

Oct 14 '05 #2

P: n/a
nikki a écrit :
si******@gmail.com wrote:
hello all:

I have a pop up window is for the user to submit some information.
That window is refreched a few times with the user inputs (its a form
submit in itself... couple of times). I would like that window to close
after the user submits a rating and refreshed the original page that
opened the window.

I cant use opener.document.refresh because afterall the page isnt
considered the opener after the user posts the information on the pop
up window.

am i making any sense?

Yes, but it is the same window, and it's the window that cares. At
least, in theory. :)

And it's reload, not refresh.

Give it a shot.

self.opener.document.reload(true);


reload is a location method, not a document method.
And what the original poster needs, I am pretty sure he does not need to
reload the opener.

Gérard
--
remove blah to email me
Oct 14 '05 #3

P: n/a
Nop Not Working....

My code is (for the reference...)

On teh parent:

function newwindow(url) {
newwindow2=window.open('','CallMePopUp','status=no ,scrollbars=yes');
var tmp = newwindow2.document;
tmp.write('<html><head><title></title>');
tmp.write('</head><body><form name="formName" method="post"
action="calc.php">');
tmp.write('<input type="hidden" name="prodh" value="bred">');
tmp.write('</form>');
tmp.write('</body></html>');
tmp.close();

tmp.formName.submit();

}

On the chiled:

function exit ()
{
//opener.document.form['new_entry'].submit();
self.opener.document.reload(true);
close ();
}

The quoted is the one I used before...

Oct 14 '05 #4

P: n/a
You are right... I really need to post some information to teh opener,
and THAN to reload it ... or better tu SUBMIT in it...

but I cannt... at least I dont know how...

Oct 14 '05 #5

P: n/a
si******@gmail.com wrote:
Nop Not Working....

My code is (for the reference...)

On teh parent:

function newwindow(url) {
newwindow2=window.open('','CallMePopUp','status=no ,scrollbars=yes');
var tmp = newwindow2.document;
tmp.write('<html><head><title></title>');
tmp.write('</head><body><form name="formName" method="post"
action="calc.php">');
tmp.write('<input type="hidden" name="prodh" value="bred">');
tmp.write('</form>');
tmp.write('</body></html>');
tmp.close();
I think that will be a bit nicer as:

tmp.document.write(
'<html><head><title></title>'
+ '</head><body><form name="formName"'
+ 'method="post">action="calc.php">'
+ '<input type="hidden" name="prodh" value="bred">'
+ '</form>'
+ '</body></html>'
);
tmp.document.close();

tmp.formName.submit();

tmp.document.forms['formName'].submit();


}

On the chiled:

function exit ()
{
//opener.document.form['new_entry'].submit();
-----------------------------^

I take it you are aftert he *forms* collection?

opener.document.forms['new_entry'].submit();

self.opener.document.reload(true);
close ();
}

The quoted is the one I used before...


Untested, but shoule be OK.
--
Rob
Oct 15 '05 #6

P: n/a
si******@gmail.com wrote:
[...]
On the chiled:

function exit ()
{
//opener.document.form['new_entry'].submit();


opener.document.forms['new_entry'].submit();

----------------------------^
[...]

--
Rob
Oct 15 '05 #7

P: n/a
used: opener.document.forms['new_entry'].submit();

Still not working... the parent window is not refreshin or submiting...

Help please...

Oct 15 '05 #8

P: n/a
I have opened FireFox that gives a better JS concole... and I am
getting

Error: opener.document.new_entry.submit is not a function
Source File:
Line: 47

Oct 15 '05 #9

P: n/a
SirShurf wrote:
I have opened FireFox that gives a better JS concole... and I am
getting

Error: opener.document.new_entry.submit is not a function
Source File:
Line: 47


That means that the form new_entry doesn't exist as far as the function
is concerned (it may actually be in the page).

Try the following:

<html><head><title>Child play</title>
</head><body>

<script type="text/javascript">

function newWin(url) {
newWin2=window.open('','CallMePopUp','');
var tmp = newWin2.document;
tmp.write(
'<html><head><title></title>',
'</head><body><form name="formName" action="">',
'<input type="text" name="prodh" value="bred">',
'<input type="submit">',
'</form>',
'<input type="button" value="Submit parent form" onclick="',
' window.opener.document.forms[\'new_entry\'].submit();',
'window.close();',
'">',
'</body></html>'
);
tmp.close();
}

</script>
<input type="button" value="Open child" onclick="newWin();">
<form name="new_entry" action="">
<input type="text" name="blah" value="afasdf">
<input type="submit">
</form>

</body></html>
--
Rob
Oct 15 '05 #10

P: n/a
I ahve used your script... and thats what I got..

Error: window.opener.document.forms.new_entry has no properties

Oct 15 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.