Reputation: 36028
I have a page (Page A
) where user can send email to others, then user should can choose the recipients.
So when user click the "Choose contact" button in Page A
, a new browser page (Page B
) will open where all their contacts in the database will be displayed using the check box list.
Then the user can choose the contacts he want, when he click "OK" button in Page B
,the Page A
will close. Then how should I get, in Page A
, the contacts the user chosen over at Page B
?
Upvotes: 0
Views: 301
Reputation: 196002
If you indeed open a new window, you can use the window.opener
to talk with the parent window.
I would suggest, though, that you use an ajax call to fetch the contacts and display them in the current page (perhaps in an overlay).
Upvotes: 1
Reputation: 61812
There are several ways to do this. I believe the simplest is a pure JavaScript solution.
Create a JS function on the parent page that will handle the contacts that are received. When the submit/finish button is clicked on the child page, pass the selected contacts to the parent by using
window.opener.SomeFunctionName(arrayOfContactsOrContactIDs);
Upvotes: 1