473,386 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How do I refresh target window?

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
10 23668

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
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
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
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
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
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
used: opener.document.forms['new_entry'].submit();

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

Help please...

Oct 15 '05 #8
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Baffin Shea | last post by:
Dear All, I am a beginner in javascript and looking for help, I put the following script in the original.asp: function NewWindows() { window.open("abc.asp", "new") }
5
by: LL | last post by:
Hi, I have grid's col defined as HyperLinkColumn, I defined the Target as "_blank" to force open a new winodw. When the new window is closing, how to refresh the parent window? Thanks.
5
by: Tmajarov | last post by:
Haven't been able to find a clear answer to this... I am building an asp.net application and trying to enforce some work flow by displaying a form via the showmodaldialog method. I can get the...
4
by: Xerxes | last post by:
Hi, a newbie question: How can I refresh a page in a separate frame. For example, when someone logs in in the main frmae, I want to refresh another frame to display info differently. TIA.
8
by: Jason S | last post by:
Hi, is there any way of getting my VB (6.0) program to automatically 'Refresh' an IE window that might be active (window status not applicable). It needs to be able to determine which active IE...
6
by: Wolf Grossi | last post by:
Greetings, how to refresh a parent window after processing forms from the subwindow? Currently I have a solution (see below) which works with IE and Konqueror, but not with Firefox, so I...
1
by: Wolf Grossi | last post by:
Greetings, how to refresh or reload a parent window after processing forms from the subwindow? Currently I have a solution (see below) which works with IE and Konqueror, but not with Firefox,...
1
by: helraizer1 | last post by:
Hi folks, and folkesses. I have a piece of java script for a dynamic menu (code below). <ilayer width=100% height=50 name="dep1" bgColor="#000000"> <layer name="dep2" width=100% height=50>...
35
by: Kaante | last post by:
Hi, i want a frame on my website to display one pic if the user has new messages and another different pic if it dsnt. Before i used html to auto refresh page every 10 secs. that was annoying...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.