Link to home
Start Free TrialLog in
Avatar of tso11
tso11

asked on

Passing values between parent and popup using Javascript

I am trying to do the following using Javascript, and I was hoping someone might be able to provide basic code (using two html pages and javascript functions) to accomplish it:

1) Use HTML form to collect a parameter or two from user
2) Pass that data to Popup window
3) Display that data in the popup window
4) Write something (i.e. "Successful") to parent window when user clicks button on popup (and close popup as well).

Thanks!
Avatar of aisebastian
aisebastian
Flag of Romania image

Hi,

This is how i did it... It works on most browsers.

This is how i changed values of fields in parent windows, based on input in child popup

You can send data to child via GET parameters with PHP, or program the child popup to collect the data as shown below from the parent onload.
object = window.opener.document.getElementById('id_of_field')
object.value = 'new value of field';

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of me655321
me655321

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 tso11
tso11

ASKER

Worked perfect!  Thanks!