Turbo,
Find below an example. I am using a form in the main window (name is lead) that contains lead information. A couple of the fields come from a different database (accounts). From the main form I call a "Find account" script that searches the database and fills the values.
Once I click the "Pick account" link, my popup closes and the main form account information is filled with the account information from the popup.
thx,
Dik
The javascript code:
function changeAccount(account, address, city, country, account_id, contact, email)
{
opener.document.lead.account_id.value= account_id;
opener.document.lead.account.value= account;
opener.document.lead.address.value= address;
opener.document.lead.city.value= city;
opener.document.lead.country.value= country;
opener.document.lead.contact.value= contact;
opener.document.lead.email.value= email;
close();
}
the "Pick Customer" line:
echo "<a href=\"javascript:changeAccount('$account','$address','$city','$country','$account_id','$contact','$email')\" onClick=\"javascript:changeAccount('$account','$address','$city','$country','$account_id','$contact','$email')\">Pick customer</a>";