/    Sign up×
Community /Pin to ProfileBookmark

Returning value to opener

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.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@requestcodeOct 27.2003 — 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()

}
Copy linkTweet thisAlerts:
@wehtikoauthorOct 27.2003 — 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.
×

Success!

Help @wehtiko spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...