473,386 Members | 1,785 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,386 software developers and data experts.

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 4046
Option 1 is to use a query string
string TextBox1= document.getElementById('ParentTextBoxname');
Window.open ("popup.aspx?text=" + 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.document.forms[0].ParentTextBoxname.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*********@discussions.microsoft.com> wrote in message
news:D7**********************************@microsof t.com...
Option 1 is to use a query string
string TextBox1= document.getElementById('ParentTextBoxname');
Window.open ("popup.aspx?text=" + 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.document.forms[0].ParentTextBoxname.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.document.getElementById("TextBox1"). 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*********@discussions.microsoft.com> wrote in message
news:D7**********************************@microsof t.com...
Option 1 is to use a query string
string TextBox1= document.getElementById('ParentTextBoxname');
Window.open ("popup.aspx?text=" + 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.document.forms[0].ParentTextBoxname.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
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...
1
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...
29
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...
2
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...
5
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...
2
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...
6
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...
4
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
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
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...
0
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,...

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.