473,770 Members | 4,999 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

obtaining field Id from the parent window in pop up window using window.opener

1 New Member
Hi Guys,

I am trying to get the Field Id from the Parent Window in the pop up window using window.opener ex:

Expand|Select|Wrap|Line Numbers
  1.    var var1 = window.opener.document.getElementById("text1").value;
  2.   alert(var1);
I also used as window.opener.d ocument.loginFo rm.text1.value but the field value is not getting in the pop up window. What am i missing here. Please let me know what i am missing here.


Thanks,
Kalyan
May 22 '07 #1
5 2595
rizwan328
1 New Member
Hope this will work for you
Expand|Select|Wrap|Line Numbers
  1. <script language="JavaScript">
  2.     alert(opener.document.getElementById('txtDetailsURL').value);
  3. </script>
I used it's working fine.

Regards,
Muhammad Rizwan Javed
Software Engineer
Mechtechnologie s, Lahore Pakistan
Jun 19 '07 #2
Arockalypse
25 New Member
You are right Ali i use this too its very good!!!
Apr 12 '08 #3
acoder
16,027 Recognized Expert Moderator MVP
I am trying to get the Field Id from the Parent Window in the pop up window using window.opener ex:

Expand|Select|Wrap|Line Numbers
  1.    var var1 = window.opener.document.getElementById("text1").value;
  2.   alert(var1);
I also used as window.opener.d ocument.loginFo rm.text1.value but the field value is not getting in the pop up window. What am i missing here. Please let me know what i am missing here.
The things that could be missing are that it's not being correctly referenced, or it can't access it, e.g. parent window is closed. The best thing to do is check the error console in a decent browser (unless it affects one browser only).
Apr 12 '08 #4
acoder
16,027 Recognized Expert Moderator MVP
Hope this will work for you
Expand|Select|Wrap|Line Numbers
  1. <script language="JavaScript">
  2.     alert(opener.document.getElementById('txtDetailsURL').value);
  3. </script>
I used it's working fine.
That might work for you, but it assumes that there is an element with an id of "txtDetails URL" which the OP probably won't have and it's very similar to the original code anyway.

Also note that the language attribute of the script tag has been deprecated in favour of the type attribute:
[html]<script type="text/javascript">[/html]
Apr 12 '08 #5
acoder
16,027 Recognized Expert Moderator MVP
You are right Ali i use this too its very good!!!
Er... who's Ali?
Apr 12 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
11116
by: Debbie Davis | last post by:
Hi there, I'm not very good at javascript but I'm using the following to close a child window and refresh a parent window after updating a database. It's within an ASP page. CODE <SCRIPT> function CloseWindow() { if (window.opener && !window.opener.closed) { window.opener.document.location.reload(); window.close();
1
3763
by: Marshall Dudley | last post by:
I have an application where in a shopping cart checkout a popup appears which suggests other items that may go with what was ordered with a button to add these items to the cart. When the button in the popup is clicked, the popup should present an added items to cart message, close, and reload the parent window, so the parent will show the new item in the cart. It is all working except the post contents for the parent window are being...
2
5100
by: Snolly | last post by:
Hi all, Here is my issue. I have a web page (lets call it page1) with an iframe in it that then opens a pop-up window (page2). The pop-up window is used to edit some data that was loaded into page1 so I want to use onunload to reload page1 to keep the data synchronized. At first I was using just window.opener.parent.location = window.opener.parent.location;
2
23511
by: Raj | last post by:
Hi All, I have a problem with trying to refresh the parent window from child window in order to update data in the parent window. The sequence of events are 1) I click a button in the parent window to open a child window thru javascript window.open 2) I have some functionality in the child window that changes the data
4
2766
by: Earl Teigrob | last post by:
I am thinking about using a popup window to edit settings that will affect parent asp.net page. The data that is changed in the popup window will be saved to the datastore that is loaded and displayed by the parent page. In order to refresh the parent page, I would like to raise an event in the popup (child) page that is subscribed to by the parent so that I can rebind the data in the parent page once the data in the child window data is...
5
4608
by: Peter | last post by:
1) I have a C# web application and what I am trying to do is create a popup window from a link on the parent window 2) the popup window will have a button and when a user clicks on the button the program should update a database, close the window and refresh the parent window. My question is does anyone have a example of popup window wich will close it's self and refresh the parent window when a user clicks on a button? I know there are...
4
9746
by: Phil Powell | last post by:
I thought this would work but it seems to not work neither in Netscape nor in IE: <script type="text/javascript"> <!-- // OBTAINED FROM http://www.javascripter.net/faq/settinga.htm // NOTE THAT IF YOU SET days TO -1 THE COOKIE WILL BE SET TO YESTERDAY
1
2300
by: jerkyjerk | last post by:
Ei guys..newbie in programming..just want to ask how will I compare the contents of particular cell of the table(from parent window) to the contents of a cell of the table (child window)? how will I use ID for this? I need to compare because If the two contents are the same, no need to add the table (from the child window) to the table on the parent window.. this is my code Child window note: cell3 contents will be the basis of...
1
9411
by: Bali | last post by:
Default.aspx is the starting page containing a control(ascx) which has asp:button control on it. On the button click event it has to open a new page as a modal control. Since refreshing a page in a dialog box ended up opening up a new browser window with the aspx page, I read on a forum that I should use the iframe control and since I have to open a bunch of pages as diaogboxes, I created a general page(Container.aspx) which has an...
0
9592
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10059
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10005
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8887
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6679
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5452
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.