Solved

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

Posted on 2016-11-01
4
54 Views
Last Modified: 2016-11-02
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
Comment
Question by:karthik80c
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 22

Expert Comment

by:Kim Walker
ID: 41869634
It's just window.opener. See reference.
0
 

Author Comment

by:karthik80c
ID: 41869652
Hi Kim Walker

I need to identity which link caused the popup and set the value in it
0
 
LVL 22

Accepted Solution

by:
Kim Walker earned 500 total points
ID: 41869667
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
 

Author Comment

by:karthik80c
ID: 41869880
Actually we need to set it to a texbox value . Its working thanks Jim
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question