JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 13th, 2001, 12:52 AM
pleaselah pleaselah is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: singapore
Posts: 2 pleaselah User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation

Hi ! any one knows how to pass the value of a form from a main window to another child window's form value using javascript??

the value need to be pass to the text field of the form value!

The child window is open when a link in the main window is click and it pop_up the child window.

Reply With Quote
  #2  
Old February 13th, 2001, 09:16 AM
estrabd's Avatar
estrabd estrabd is offline
o0o.o0o
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: m00n
Posts: 194 estrabd User rank is Second Lieutenant (5000 - 10000 Reputation Level)estrabd User rank is Second Lieutenant (5000 - 10000 Reputation Level)estrabd User rank is Second Lieutenant (5000 - 10000 Reputation Level)estrabd User rank is Second Lieutenant (5000 - 10000 Reputation Level)estrabd User rank is Second Lieutenant (5000 - 10000 Reputation Level)estrabd User rank is Second Lieutenant (5000 - 10000 Reputation Level)estrabd User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 h 15 m 59 sec
Reputation Power: 101
Send a message via ICQ to estrabd Send a message via AIM to estrabd Send a message via Yahoo to estrabd
Post

Lets assume that you open a pop up from a main window that contains a form:
Code:
<form name="mainForm">
<input name="formElementName" type="text" value="">
...
</form>

The form on the main window can be accessed by the pop up window by simply calling the value of the main form element you want to carry over in this manner:
Code:
opener.document.mainForm.formElementName.value

follows the standard hierarchy:

window.document.form.formElement.[property or method]

This would go in the pop up window of course. It would need to be used on an "onLoad" event in the body tag, and it would look something like this:
Code:
<body onLoad="self.document.childForm.childFormElement.value = opener.document.mainForm.formElement.value;">

<form name="childForm">
<input name="childFormElement" type="text" value="">
...
</form>

Depending on the browser you are using, this method should work.

You can find a lot of information about the Window Object at:
http://developer.netscape.com/docs/...jsref/index.htm


[Edited by estrabd on 02-13-2001 at 08:35 AM]

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Javascript Problem ! Urgent! please help

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap