Link to home
Start Free TrialLog in
Avatar of Sid123
Sid123

asked on

passing values through pop up

Hi,
   I want to pass a value from a pop up window to the parent window...this works using the code in the popup window

<a href="javascript:self.close()" onclick="opener.location='test.php?id=<?echo $a_rows["id"]?>'">test</a>

but this refreshes the parent window. Is it possible to pass the value without refreshing the parent window?

Sid
Avatar of CosminB
CosminB

Do you want to pass it to php or to javascript?
if you want to pass it to the same page that opened the window(to php not Javascript) you can't do it without refreshing the page. At most you can refresh only a part of your page that is contained in an iframe or a frame
ASKER CERTIFIED SOLUTION
Avatar of madwax
madwax

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sid123

ASKER

Hi madwax,
    I actually didnt get what you wrote. I have a php file test.php which opens a popup test1.php . So I need to send some value from test1.php to test.php by closing the pop up i.e test1.php ....and as I said by using the code I am using test.php gets refreshed.
   If I go according to what you suggested...then how should I go about. I didnt understand form and text field part.


Sid
Oki, sorry, It was kind of late when I wrote it.

It all depends on what kind on for what you want to use the variable sent from the pop-up. If you want to use it in the openers php-code, it isn't possible to do so without a refresh. On the other hand if you only want to dsiplay it on the opener page, or use it in some sort of e.g. javascript you can send it back to the opener through the DOM, i.e. use the path opener.object.attribute.value and an example of this can be a text-field within a form on the opener page as I wrote above. To conclude it all depends on what you want to use the variable for.

hope this made it a little bit clearer...
//jan