473,698 Members | 2,630 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Moving value from popup Webform to main Webform?

VMI
How can I transfer some text from a Textbox in a popup window to the main
webform that opened that popup?
The popup webform will have some type of Button that the user will click in
order to accept those changes. This is where the transter of the value should
be. It could also be done when I close the popup form (whichever is easier).
Once the popup form is closed, the value will then be used to fill a textbox
in the main Form.
I use VS2005 v2.0.

Thanks.

Oct 9 '06 #1
1 2115
1. pass a text box name (client-side name) from the main form to the
popup form (in the url).
2. the popup form gets a reference to it's "opener." Search for
window.opener in google. Note: getting a reference to the opener
could vary depending on browser type and the way the window is opened.
See also showModalDialog .

Example:
<script type="text/javascript">
var OpenerWindow = window.opener; // for when using window.open
if (OpenerWindow == null) {
OpenerWindow = window.dialogAr guments; // for when using
window.openModa lDialog
}
</script>

3. the popup form sets the text box in the parent form to a value
window.opener.t extboxname.valu e = 'hello';
a) You can build this string dynamically in the code-behind - string
together the command with the proper text box name.
b) You can build this string dynamically in javascript using the
javascript eval( ) command: eval( 'window.opener. ' + textboxname +
'.value') = 'hello'. Not sure on the syntax here, but it's something
like that.

Oct 9 '06 #2

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

Similar topics

1
2632
by: Martin John Brindle | last post by:
Is it possible to return a value from a popup window? I really need something that can do this and the behaviour of the createpopup method is perfect except i can't work out how to return a value. As an aside, I can't use other url's, which means it all needs to be contained within the one file, but that's something I can solve later! Martin
4
10489
by: Davey | last post by:
I have a website which has a popup window (this only opens when the user chooses to open it). In the popup window I have a <select> control which lists a selection of "classes". Each class has a description and a class_id (stored in the value attribute of each option). The user will then select a class from the drop-down list. What I want to do is have a control in the parent browser window which can store the class_id and the...
1
1436
by: Thierry | last post by:
Hi, I want to make a calendar popup in ASP.net, but how can I get a selected date from my popup to the textbox on my webform? I use a Calendar component in my popup and I can't get the selected date in the textbox on my (main) webform. Thanks, Thierry
1
1638
by: mg | last post by:
I want to disable a TextBox in the WebForm that opens a popup Webform ... from the popup WebForm. The following javascript code doesn't work: window.opener.document.getElementById("TextBox1").Enabled = false; What am I doing wrong? Could you provide a solution?
3
1840
by: Aitham alama | last post by:
Hi There, My question is as following, I have a webform (Webform1) which contains one label control and command button, when the user clicks the button another webform (Webform2) appears, webform2 contains only one control which is the Calendar control, I want to do the following 1- when the user selects a date from the webform2, I want the value
3
3977
by: Ipsita | last post by:
Hi, I am explaining the scenario of what I am trying to do: - I have a webform with some controls, from which I am taking the data. eg say Username, password - I am passing these data as parameters to the web service method result = serviceproxy.VerifyUser(username, password) on the event of the "Submit" button_click. - The webservice webmethod uses the username, password to verify if the user is valid user. If no, it sends an error...
2
2068
by: tao lin | last post by:
Hi, all I am using VS2003 under WinXP. My WebApp has a WebForm which has a html form has some search condition textbox, once the user fill in the condition and click submit button. My app will stay in the same WebForm but open a popup window in the browser to show the search results. So I implement like this: private void btnSubmit_Click(object sender, System.EventArgs e)
1
2524
by: Seok Bee | last post by:
Dear Experts, Currently I am creating a webform using sp.net 2.0. I would like to create a date picker in my webform. I managed to create a a button to call-up the calendar and using the Calendar control from the toolbox. I would like to know how can I pass the value back to a textbox in my original form with the selected date from the calendar? Also, can I have the selection of the time as well? Regards,
2
2377
by: ruca | last post by:
Hi, Can anyone tell me please how can I return values from a popup to a UserControl. I use the same "method" like to return to a WebForm, but it not works in UserControl case. I have this code to return from popup to webform: ------------------------------------------------------------------------ sbScript.Append("<script language='javascript'>")
0
9031
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
8871
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
7739
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
6528
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
5862
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
4371
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3052
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
2336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
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.