Click to See Complete Forum and Search --> : Returning value to opener


wehtiko
10-27-2003, 08:43 AM
Hi,

I would like to know how to return a value to the "opener" window when the pop-up window close. For example, let's say I have an input field that contains a client ID. Since the user doesn't know the client ID, he will click on a button to find the client, select the client and then click OK. Then, the client ID will transfert in the Client ID field. Any hint will be greately appreciated!

Best regards,

Denis Dupere.

requestcode
10-27-2003, 09:23 AM
You can populate a form field or variable in the "opener" window from the popup by this method:
form field:
opener.document.form_name.field_name.value="some value"

variable:
opener.variable_name="some value"

You could create a function that gets performed when the click the "OK" button. Something like this:

function myfunc()
{
opener.document.form_name.field_name.value="some value"
window.close()
}

wehtiko
10-27-2003, 01:08 PM
Thanks for your reply. I did try this before my post with no success. Following your reply, I decided to test my page on another machine and it worked just fine. Do you have any idea why it doen't on my computer? I've re-installed Internet Explorer, reset the security level to default and reset the advanced options to default and it still doesn't work.