I got a problem with a webmail application (akasha mail - see sourceforge.net). The page to create a new mail should have a button to call the addressbook in a new popup window.
Here the user should click on an displayed e-mail address to add it to the 'to:' field of the parent window and the addressbook window closes.
I managed to open the new window and display the user's addressbook. but how do I get the variable to the parent window, without reload it (and loose the written mail) and add it to the recipient field where perhaps is already an address?
I searched the archiv for the words 'parent window transfer, data, post, ' but without success. (if you could find a matching thread, please post it)
here are the important lines of code:
(from the parent window - new_message.php : )
echo " <script language='JavaScript'>\n";
echo " function addopen(){\n";
echo " window.open('addrpopup.php?ID=$ID',target='popupwindow')\n";
echo " }\n";
echo " </script>\n";
<snip>.....<snip>
echo "<form name='myForm' method='post' action='postmail.php?ID=$ID' onSubmit='submitonce(this)'>\n";
echo " To: \n"; $to = rawurldecode($to);
echo " <input type='text' name='to' class='stiltextfield' value='$to'>\n";
echo " <a href='#' onClick='addopen()'>Add new from adressbook</a> \n";
<snip>
// comment: the $to variable perhaps is already filed with an address if the user clicked
on it in an other addressbook-view. so i would have to append it or use a new one.
$ID is the user-id
until here it works fine.
(and from the addressbook (addrpopup.php) : )
echo " <a href=' window parent ?ID=$ID&to=$txtemail'>$txtemail</a> </td>\n";
// $txtemail is the mail-address to 'captue' and send to parent window.
my question: if i use a javascript post (which?), how do i catch the value in the parent? is there another way?
allan