Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 21st, 2004, 02:03 AM
Authorized User
 
Join Date: Nov 2003
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to eapsokha
Default Trasferring value from one to one window

Suppose a user click a link from one windows to load another form in a popup window. When he applies OK then the a field of the first window will retrieve the input from the second form without lossing the current value. How can I do that? I am sorry if my question is complicated.

Many thanks

__________________
Mr. Sokha Eap
Webmaster
UNDP Cambodia
 
Old March 2nd, 2004, 10:36 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 217
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mega
Default

You can do it with JavaScript or VBScript (only in IE) in the browser envoriment.

 - mega
 
Old March 3rd, 2004, 09:09 PM
Authorized User
 
Join Date: Nov 2003
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to eapsokha
Default

I am poor with Javascript. So could you show me the sample code?

 
Old March 4th, 2004, 11:42 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 217
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mega
Default

Quote:
quote:>the first window will retrieve the input from the second form without lossing the current value.
What value?

This should work in all browsers except NN 2 and before:
Code:
opener.document.forms["userData"].age.value = document.forms["entry"].userAge.value;
What happens?
All browsers assign an opener property to a window created via the window.open() method. In my example the <form> in the second window is userData, with the text field age and the first <form> is entry with the text field userAge. This script should reside in the subwindow. The opener property is not assign if opened by the user (then it's NULL). You can check for that by using this code snippet:
Code:
if (typeof window.opener == "object"){
  // current subwindow opened by script
}
Happy programming (like their say on 4guysfromrolla). :)

- mega
 
Old March 5th, 2004, 01:54 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 217
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mega
Default

The last snippet would look something like this in VBScript:
Code:
If (IsObject(window.opener)) Then
  // current subwindow opened by script
End If
- mega





Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing parent window from child window arnabghosh Javascript How-To 1 December 26th, 2007 01:18 AM
Centering Popup window & Blur Parent window jkusmanto Javascript How-To 0 May 25th, 2007 03:19 AM
Window refresh and window pop up in Java Script Aleksandra Javascript How-To 2 March 2nd, 2007 06:47 PM
closed parent window when opened child window jaiwin Javascript How-To 0 October 8th, 2006 12:54 PM
Close Parent window on opening child window pkdev Javascript How-To 8 April 11th, 2004 12:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.