473,756 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

passing values between child and parent windows

17 New Member
Hi
I am uing C#.net & using javacript for a popup window.

I've a form and there is a button named Categories. When it is clicked, it will open a new window for the selection of categories.
When the categories are selected from ListBox ,and the submit button of the popup window is clicked, the category id value should be set in the parent form and the popup window will close.

the problem is that the parent window form doesn't get the value of the selected listbox item of popup window.

Anyone plz help me out.
Sep 26 '06 #1
4 12598
neena
17 New Member
anyone please tell me how to pass the selected value from a listbox in popup window(child window) to a textbox in parent window

please help me...i am new in javascript
Sep 26 '06 #2
ronverdonk
4,258 Recognized Expert Specialist
Assuming:
Mainform is the form name in the main window,
Name_field is the text box where the value must be placed,
ChildForm is the form name in the child window,
Name_field is the name of the select group:
[HTML]opener.document .forms["Mainform"].Name_field.val ue =
ChildForm.Name_ field.options[ChildForm.Name_ field.selectedI ndex].value[/HTML]

Ronald :cool:
Sep 27 '06 #3
neena
17 New Member
Thank u Ronald for replying.its working now.But how will i get the values to the listbox from database.If its server control then its ok.But in javascript how will we get the values?

Please reply

Neena

Assuming:
Mainform is the form name in the main window,
Name_field is the text box where the value must be placed,
ChildForm is the form name in the child window,
Name_field is the name of the select group:
[HTML]opener.document .forms["Mainform"].Name_field.val ue =
ChildForm.Name_ field.options[ChildForm.Name_ field.selectedI ndex].value[/HTML]

Ronald :cool:
Sep 30 '06 #4
Annaleria
1 New Member
I'm afraid that the basic answer is you can't. Javascript cannot communicate with server side databases.
Oct 13 '06 #5

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

Similar topics

11
6867
by: Mike M | last post by:
Is it possible? In the parent process, I have a socket that binds, listens and then accepts new connections (which creates new sockets in the process). I want to be able to pass some of these new sockets to a spawned process. Is it possible, and if so how? Any help is much appreciated!! Mike
4
13126
by: John MacIntyre | last post by:
Hi, I have a page with a series of child pages loaded into an iframe. When I move from page to page, I store an object containing the child's control data in a variable on the main page, then use that data to populate the controls when the child page is opened again. One of these objects contains an Array, and the page reloads fine using myArray, myArray, etc... But when I try perform some array methods on it (i.e.slice) ... it does...
1
2423
by: cirillo_curiosone | last post by:
Hi, i'm new to javascript. I started studing it on the web few weeks ago, but still haven't been able to solve one big problem: HOT TO PASS VALUES FROM A SCRIPT VARIABLE TO A CHILD HTML GENERATED BY FUNCTION. Here'e the point: I'm writing a simple website for showing my photographs. It has a central page with many links (as many as galleries are).
4
2812
by: eBob.com | last post by:
I have a "parent" form (if that's the right terminology), Form1. I declare two public values in the parent form : Public Class Form1 Inherits System.Windows.Forms.Form Public CurDir As String = Directory.GetCurrentDirectory() 'used by FormGetJobOutput Public PubUser As String 'tbxUser.text value for subForms In the "child" form, I call it FormGetJobOutput, I reference these two public values ...
3
3888
by: luna | last post by:
i have a parent form which opens a child form, i need to pass a variable back to parent then reload parent so parentopens child, child passes to parent, child closes, parent reloads its only a single variable is this possible ?
0
1619
by: ssrivani | last post by:
hi all, I have a parent window default.aspx which has a textbox(txtBox1) with multiline property and a button.when the button is clicked a child window pops up child.aspx. I have four textboxes in child.aspx and a submit button.What I want to happen is when I click the submit button all the values must be displayed in the multiline textbox in a table format with header and the values below or any formatted display with headers.
1
17651
by: pingalkar | last post by:
Hi, In my application, I call one popup winodow by using this link.. <a href="#" onClick="return showWindow('1','XYZ');"> <img src="images/magnifier.gif" ALT="Chemicals" width=18 height=20 border=0> </a> In this showWindow function.... var newWindow = '';
1
2912
by: jiaudheen | last post by:
hi i have a multiline textbox and a button in parent form. in the child form i have text boxes,comboboxes,button. the thing is i click the button in the parent form ,the child form opens. i fill the text boxes,selct the value from combo box and click ok button in child form. on clicking these values shoud be passed to the multiline txt box of parent form and should displayed there... can any one help with deatil c# code. i'm a begginer in...
6
1941
by: raylopez99 | last post by:
This thread is about how variables or parameters (including objects) are passed between forms (namely, using parameterized constructors, e.g., to pass an int between forms (e.g., a calling form and a called dialog form) (see below). My question is that though this works fine, and is consistent with everything I learned in C++, is there a 'better' way to pass information, including member variables, objects, and the like, other than...
0
9431
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9255
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
9844
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9689
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8688
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
7226
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
6514
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();...
2
3326
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2647
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.