Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Moving value from popup Webform to main Webform?

Reply
Thread Tools

Moving value from popup Webform to main Webform?

 
 
=?Utf-8?B?Vk1J?=
Guest
Posts: n/a
 
      10-09-2006
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.

 
Reply With Quote
 
 
 
 
GroupReader
Guest
Posts: n/a
 
      10-09-2006
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Free Moving Estimate, Local Movers, Long Distance Moving, PackingSupplies, Storage Rental, Home Moving, Apartment Moving, Office Moving,Commercial Moving linkswanted ASP .Net 0 01-06-2008 04:45 AM
Passing property values from popup to Main Webform? =?Utf-8?B?Vk1J?= ASP .Net 5 10-11-2006 05:16 PM
Using one webform to set a value on another webform =?Utf-8?B?bXN1aw==?= ASP .Net 1 07-12-2006 07:23 PM
Main > Popup > Popup > Close popup AND new URL in main? Jens Peter Hansen Javascript 7 06-19-2004 08:56 PM



Advertisments