Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2016-11-01
4
Medium Priority
?
60 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

719 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