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

Home Posts Topics Members FAQ

ass values between two pages

hi all,

when a user click a button on 'parent' page, then 'child' page pop-up and get
focusd. When user select data from two dropdown box (or other controls), then
they click submit button at 'child' page, then the 'child' page closed itself
and return values to 'parent' page (two textbox).

How can I do this in JavaScript? The reason I am using JavaScript because other
programmers web apps will also call my 'child' page too.

Thanks in advance.
Mar 5 '06 #1
2 1002
Pass the selected values back to a function on the calling page

//Calling Page
function myChildHanlder( valueForAction )
{
//Take some action here with the value passed to me
//Usually pass this to a hidden field
__doPostback();

}

//On Child Form

window.opener.myChildHandler( theValueToPassBack );

//In Asp.net
On PreRender event, look at the hidden field and act upon it.
HTH

--
Terry Burns
http://TrainingOn.net

"Jason" <j@NoSpamPlease.org> wrote in message
news:ep********************************@4ax.com...
hi all,

when a user click a button on 'parent' page, then 'child' page pop-up and
get
focusd. When user select data from two dropdown box (or other controls),
then
they click submit button at 'child' page, then the 'child' page closed
itself
and return values to 'parent' page (two textbox).

How can I do this in JavaScript? The reason I am using JavaScript because
other
programmers web apps will also call my 'child' page too.

Thanks in advance.

Mar 5 '06 #2
The directions:

The parent calls window.showModalDialog("child.aspx",...)

If child.aspx doesn't take any server-side action on clicking "Submit", make
"Submit" a simple html button and handle onclick event in javascript. In
javascript event handler make an object encapsulating the selected values
you want to pass back to the parent form. Assign this object to
window.returnValue and call window.close();

The parent will get the object as the return value of the showModalDialog
call. It can take separate selected value contained in the object and assign
them to the textbox's value property.
Eliyahu

"Jason" <j@NoSpamPlease.org> wrote in message
news:ep********************************@4ax.com...
hi all,

when a user click a button on 'parent' page, then 'child' page pop-up and
get
focusd. When user select data from two dropdown box (or other controls),
then
they click submit button at 'child' page, then the 'child' page closed
itself
and return values to 'parent' page (two textbox).

How can I do this in JavaScript? The reason I am using JavaScript because
other
programmers web apps will also call my 'child' page too.

Thanks in advance.

Mar 5 '06 #3

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

Similar topics

9
29986
by: Ken | last post by:
How can I reset the initial form variables that are set with session statements when clicking on a button? I tried this but the function was not called: <?PHP function reset_form($none) {...
10
3347
by: Geoff Cox | last post by:
Hello, I have a series of pages each of which creates an array of values. How do I keep all the array values until the last page? Cheers Geoff
1
3023
by: Matt M | last post by:
Ok. So I'm passing values between web pages, as per microsoft's framework development guide (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/ht...
2
1535
by: Mark | last post by:
Hello all - I can't seem to find what could be causing this issue so I wanted to appeal to the .NET gurus out there. When I have users input values into Page 1 and submit it, I want the ability...
4
1776
by: Miguel Dias Moura | last post by:
Hello, i created an ASP.net / VB page with a really big form. Now i want to create 4 pages and in each one i will place 1/4 of the big form. The last page will send all the form values by...
1
2690
by: olduncleamos | last post by:
Hello all. With a background in ASP, I am finding the work required for passing values between pages mystifying. For various obvious reasons, I have eliminated using cookies and session to store...
8
4222
by: savvy | last post by:
I have a javascript menu navigation. I have some session values which regularly get updated, but when i navigate using this Javascript menu to a different page i'm not able to see the updated...
1
2329
by: Steve | last post by:
After a few hours of trial and error I have reached the following conclusions, can you please tell me if I am right: I have 2 aspx pages both with the same master page and I wish to pass values...
9
10354
by: =?Utf-8?B?UGV0ZXJX?= | last post by:
I have a TabControl on a Windows form in which I have various tab pages each with a DataGridView, the first column of which is a DataGridViewCheckBoxColumn and subsequent columns being...
6
1393
by: John Devlon | last post by:
Hi, I've got a small problem using 2 asp pages..... The first page has a button to go to the second page. On the second page, when the page is loaded, a check is excecuted to see if a...
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
7423
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...
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
7510
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...
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
3213
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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 ...

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.