Solved

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

Posted on 2016-11-01
4
55 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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

734 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