473,383 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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

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.document.loginForm.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 2545
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
Mechtechnologies, Lahore Pakistan
Jun 19 '07 #2
You are right Ali i use this too its very good!!!
Apr 12 '08 #3
acoder
16,027 Expert Mod 8TB
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.document.loginForm.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 Expert Mod 8TB
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 "txtDetailsURL" 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 Expert Mod 8TB
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
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>...
1
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...
2
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...
2
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...
4
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...
5
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...
4
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 //...
1
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...
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.