473,408 Members | 2,427 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,408 software developers and data experts.

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 2096
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.dialogArguments; // for when using
window.openModalDialog
}
</script>

3. the popup form sets the text box in the parent form to a value
window.opener.textboxname.value = '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
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....
4
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...
1
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...
1
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: ...
3
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,...
3
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...
2
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...
1
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...
2
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...
0
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
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,...
0
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...

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.