views:

35

answers:

1

Hello

I want to make a link on a page that when clicked, would open another page(tab). I have already done that.

Now, when the user clicks a link in the second page, I want the page to close, and a field in the first page to be updated with what the user selected in the second page.

As an example, I would like to achieve the same functionality as the Yahoo Mail address book. When you write a message, you click the "To:" field, the address book opens in a new window, you select the people you want to send the mail to, and then when you click "Done", those people's addresses are automatically added to the "To:" field in the first page.

Please give me some suggestions on how to achieve such a feature.

Thanks in advance

+1  A: 

You'll need to use JavaScript to open and close the window. When the second window closes, handle the event and then you can use window.parent.document to find and access fields on the parent window.

Adam Pope