473,511 Members | 16,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Window.opener issue

1 New Member
I have an asp page that uses javascript
Expand|Select|Wrap|Line Numbers
  1. <textarea rows="2" cols="20" name="emailto" ID="Textarea2"><%=emailto%></textarea><input type="button" onclick="javascript:window.open('page2.aspx?returnto=document.form1.Textarea2&forms=yes&Action=EmailTo','', 'width=600px,height=400px,scrollbars=1,top=100');" value=">" name="findemail" ID="Button2">
The window pops up (aspx page) and has a textbox, they enter a name and search, then the results are displayed in a datagrid. The datagrid has a template column that is a link. When they click the link I want a particular value to go back to the asp page and display in a textbox. Here is the code for the link. I put this in the datagrid item command and when e.commandname = select it will run.
Expand|Select|Wrap|Line Numbers
  1. Dim valretto As String = Request.QueryString("returnto")
  2.                 Dim current As String = Request.QueryString("current")
  3.                 TxtValue.Text = e.Item.Cells(3).Text
  4.                 Dim strjscript As String = "<script language=""javascript"">"
  5.                 strjscript &= "window.opener.getelementbyID(" & valretto & ") = '" & TxtValue.Text & "" + "," + " " & current & " ';window.opener(" & valretto & ".focus();self.close();"
  6.                 strjscript &= "</script>"
  7.                 Literal1.Text = strjscript
  8.                 e.Item.Cells(0).Attributes.Add("onclick", "strjscript;self.close();")
  9.  
I can see it gets the correct value but it does not close the window and pass it back to the first page. When I take off to display errors I get an error Microsoft JScript runtime error: Object doesn't support this property or method. I added the .getelementbyID and now I get an error form1 is undefined.
Is this something to do with the textarea?

Thanks!
Nov 3 '07 #1
1 1318
acoder
16,027 Recognized Expert Moderator MVP
Welcome to TSDN!

JavaScript is case-sensitive. You should be using document.getElementById(). Note the capital E, capital B and lower-case D.
Nov 3 '07 #2

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

Similar topics

5
9694
by: Carol Lyn | last post by:
Could use your assistance with this. I have a window that opens via onclick and it is a small window with info about a site. If the user is interested in visiting that site, there is a link to...
3
24665
by: NeverLift | last post by:
But, if it's not open, I don't want to open it . . . using window.open will open it if it doesn't exist, even if the url in that open is null (the window is then empty -- but it's open). The...
2
18391
by: Stefan Sch?rmeli | last post by:
I already read about several problems using firefox and the window.opener property. But obviously it didn't help out. So here is my problem: I got a "Search..." link which opens a new window...
2
5071
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...
14
11018
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
3
2237
by: JohnEGee | last post by:
Hello, all, and TIA for any help you can offer. I've searched the Internet for answers and have finally come here. I've created a page (several, actually) with a link that opens a pop-up...
5
7509
by: asadhkhan | last post by:
I have the following code which works correctly in IE 6, but in IE 7, Fire Fox 2.0 and Netscape 8 it does not work. I have a main page where a button calls this pop-up and uploads a file once you...
1
8382
by: Vexander | last post by:
Hi I am trying to right a script that closes a popup and then refreshes the pener to specific URL If have this that works form me <script type="text/javascript"> ...
16
615
by: CreativeMind | last post by:
hi, i have a page calendar.aspx which returns selected date i.e window.returnValue=selectedDate; window.close(); it works fine with IE but not for Firefox. i tried...
3
4062
by: Asterix | last post by:
Hi Guys, I know this is probably an easy one, but I am having issues. Basically, I have a pop-up (child) that controls the parent window. Clicking on a link on the child window should redirect...
0
7242
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,...
0
7355
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7081
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...
0
5668
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,...
1
5066
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4737
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...
0
3225
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1576
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 ...
0
447
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.