Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 62
  • Last Modified:

Is it possible to identify to set value to the parent window using window.self.opener?

Hi Experts

We are using two pages . One is Parent window [Html page] and another one is a pop up window [Html page]  , Now we want to set a value to my parent window based on a click event done on the Pop up window . I have made the window.self.opener is able to do this . but i cant able to find and set value for the button which caused the pop up to fired .
0
karthik80c
Asked:
karthik80c
  • 2
  • 2
1 Solution
 
Kim WalkerWeb Programmer/TechnicianCommented:
It's just window.opener. See reference.
0
 
karthik80cAuthor Commented:
Hi Kim Walker

I need to identity which link caused the popup and set the value in it
0
 
Kim WalkerWeb Programmer/TechnicianCommented:
You would have to include a query string in the popup url which identifies the link.
<a id="link1" href="http://domainname.com/?link=link1" target="_blank">

Open in new window

Then in the popup window you'd have to access the query string to get the value for link.
var linkvalue = location.search.substring(6);
// linkvalue = "link1"
window.opener.document.getElementById(linkvalue).value = "some value";

Open in new window

But what value are you setting in a link? Links don't have a value attribute.
1
 
karthik80cAuthor Commented:
Actually we need to set it to a texbox value . Its working thanks Jim
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now