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
Solved

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

Posted on 2016-11-01
4
48 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
  • 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

Title # Comments Views Activity
edit .asp files 5 30
How to pass JavaScript generated HTML text form values to PHP? 5 38
VBScript on Html 15 47
Start Auto-download of File when page loads? 1 20
This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
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 …

840 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