473,734 Members | 2,647 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Open new window, passing values

I am having a little difficulty with a relatively simple task.
I have a parent webform. I have a javascript attribute added to a button to
open a new window when clicked.
The user fills in a textbox then clicks the button and on page load the
child window should grab that val run a query an present the results.

Given that I am bouncing between server side controls and client script. I
am just having a little trouble passing my textbox value over to the popup.
Any help would be appreciated.
Nov 19 '05 #1
3 4065
Option 1 is to use a query string
string TextBox1= document.getEle mentById('Paren tTextBoxname');
Window.open ("popup.aspx?te xt=" + TextBox1.value)

if query string doesnt work for you, Option 2 is to access the textbox
directly from parent.. but the popup page will need to grab this value and
postback to itself to run the query. (assuming there are no frames in parent
page) following is the javascript to access the textbox in parent window

window.parent.d ocument.forms[0].ParentTextBoxn ame.value;
"Aaron" wrote:
I am having a little difficulty with a relatively simple task.
I have a parent webform. I have a javascript attribute added to a button to
open a new window when clicked.
The user fills in a textbox then clicks the button and on page load the
child window should grab that val run a query an present the results.

Given that I am bouncing between server side controls and client script. I
am just having a little trouble passing my textbox value over to the popup.
Any help would be appreciated.

Nov 19 '05 #2
Maybe I should clarify. I think I have that portion working but I need to
send values not only to the popup but back to the parent. And I have met the
second problem with limited success.
"Sreejith Ram" <Sr*********@di scussions.micro soft.com> wrote in message
news:D7******** *************** ***********@mic rosoft.com...
Option 1 is to use a query string
string TextBox1= document.getEle mentById('Paren tTextBoxname');
Window.open ("popup.aspx?te xt=" + TextBox1.value)

if query string doesnt work for you, Option 2 is to access the textbox
directly from parent.. but the popup page will need to grab this value and
postback to itself to run the query. (assuming there are no frames in
parent
page) following is the javascript to access the textbox in parent window

window.parent.d ocument.forms[0].ParentTextBoxn ame.value;
"Aaron" wrote:
I am having a little difficulty with a relatively simple task.
I have a parent webform. I have a javascript attribute added to a button
to
open a new window when clicked.
The user fills in a textbox then clicks the button and on page load the
child window should grab that val run a query an present the results.

Given that I am bouncing between server side controls and client script.
I
am just having a little trouble passing my textbox value over to the
popup.
Any help would be appreciated.

Nov 19 '05 #3
From popup (client side javascript) , you can access a control in parent page
with following syntax (if the popup was opened with window.open)

window.opener.d ocument.getElem entById("TextBo x1").value = 'string from popup';
"Aaron" wrote:
Maybe I should clarify. I think I have that portion working but I need to
send values not only to the popup but back to the parent. And I have met the
second problem with limited success.
"Sreejith Ram" <Sr*********@di scussions.micro soft.com> wrote in message
news:D7******** *************** ***********@mic rosoft.com...
Option 1 is to use a query string
string TextBox1= document.getEle mentById('Paren tTextBoxname');
Window.open ("popup.aspx?te xt=" + TextBox1.value)

if query string doesnt work for you, Option 2 is to access the textbox
directly from parent.. but the popup page will need to grab this value and
postback to itself to run the query. (assuming there are no frames in
parent
page) following is the javascript to access the textbox in parent window

window.parent.d ocument.forms[0].ParentTextBoxn ame.value;
"Aaron" wrote:
I am having a little difficulty with a relatively simple task.
I have a parent webform. I have a javascript attribute added to a button
to
open a new window when clicked.
The user fills in a textbox then clicks the button and on page load the
child window should grab that val run a query an present the results.

Given that I am bouncing between server side controls and client script.
I
am just having a little trouble passing my textbox value over to the
popup.
Any help would be appreciated.


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
12173
by: lukeo | last post by:
I'm shelling out to an .asp (or htm) page from an application. I want to show this in a window without the address bar, etc... Is there a way I can redirect this page using javascript to a page where I can set the window height, statusbar=no, etc? Thanks, -Luke
1
1344
by: laxmi | last post by:
Is there a way to test whether a named window is open from a separate window which may not have opened the window? I have tried using: if(windowname == null) win = window.open(...) This gives an error that windowname is undefined if(window.windowname) doesn't work either (no error, but fails to
29
5021
by: wayne | last post by:
Hey there... I'm having some problems passing url parameters with an open.window command. I'm not terribly familiar with java script but here is the code below. When executed it opens the window properly but does not pass the parameter. (this is part of a coldfusion template) <a href="##"
2
2141
by: Alessandro Rossi | last post by:
Hi, I have a usercontrol with a button. In the button's click event I have to open an instance of an aspx page, passing some values to some public variables of the page. How can I call the instance of the right page? The code is the follow: //this is the webpage LookUpWebForm LUWF = new LookUpWebForm //these are the variables valued
5
8329
by: David | last post by:
Hi I don't want to use javascript to open a new window because I want to use server side code which gives me more control. I think I can not use response.redirect to open a new window and keep the current window. Is there any way to do it? Thank you! David
2
6700
by: RJN | last post by:
Hi Is it possible to a server.transfer and open the page in a new window? I need to pass values between forms and hence using server.transfer. I do not want to use query string for passing values. Regards Rjn
6
21409
by: shil | last post by:
I have a server side button that needs to do some preperation and afterwards, if everything goes well, open a new browser with a specific url. I know how to execute javascript from a server side control, adding the javascript to the attributes. I need to open the browser window AFTER the code behind event is finished. For example I have two text boxes on the form, whose values I want to send as parameters to the URL that I want to...
4
1973
by: Bob Bedford | last post by:
Hi all, I'm stuck with some php code that runs out of time limit. This is due to a long XML file process that has to save pictures on the disk. What I've now: - read XML file - parse XML file - for every article - save datas in Database
0
8776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9449
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9236
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
8186
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...
1
6735
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
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
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
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
2724
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.