pop up input window and update main window

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tkarven
Forum Commoner
Posts: 41
Joined: Tue Aug 02, 2005 10:26 pm

pop up input window and update main window

Post by tkarven »

hi,

i got a main page , when user select to update or insert new record, it pop up another new window for input purpose.

my question is , how can we notify the main page to refresh it's content after the user finish their input at the pop up window ?

beside that, i used javascript : window.open to pop up that input page. will it be blocked by those pop up blockers software ?

thx
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

answer 1:
window.opener often works well..

answer 2:
the popup may be blocked, it depends on the policies the blocker uses, each one does it a little differently. Firefox and the other Mozilla browsers are smart enough to allow ones that "you" request (most often) through an action, but IE's is not.
tkarven
Forum Commoner
Posts: 41
Joined: Tue Aug 02, 2005 10:26 pm

Post by tkarven »

hmmh, my question was, how can we notify the first window to refresh it's contents, after we update it's contents through the pop up window...

thx for ur reply ^_^
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I answered both questions you asked.
dreamline
Forum Contributor
Posts: 158
Joined: Fri May 28, 2004 2:37 am

Post by dreamline »

Have a look at the link in my sig and you'll see the result on how it's done when clicking on Ratings... Here's a little code snap i used:

Code: Select all

<body background="images/ratings_background.jpg" onLoad="javascript: window.opener.document.form3.useraction.value=1;window.opener.document.form3.songID.value='';
window.opener.document.form3.actions.value='';window.opener.document.form3.submit();">
This is not all since i also use PHP for determining whether to refresh the main page, but like feyd said windows.opener is the way to go.. :D
tkarven
Forum Commoner
Posts: 41
Joined: Tue Aug 02, 2005 10:26 pm

Post by tkarven »

icic..thx so much
Post Reply