Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Child window adds text to parent's textarea


Message #1 by "Christopher Cote" <cotec@s...> on Thu, 21 Mar 2002 14:28:56
I have another sticky problem.  I have a form in which user can type 
information into a textarea.  They can also click a button and make 
another child form appear where they can add items to a table.  This table 
should then be added to what the user has typed in the main (parent) 
page.  This is the part I'm stuck on.  How do I have the text that is 
added in the child window added to the text in the parent page?  I am 
using 2 ASP pages where the child window is popped up with a querystring, 
if that matters.  I have never worked with this functionality before so if 
somebody could please explain the solution completely for me, I'd 
appreciate it.

Thank you in advance,
Chris
Message #2 by "Debreceni, David" <Debreceni.David@h...> on Thu, 21 Mar 2002 10:48:42 -0500
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C1D0EF.E0632680
Content-Type: text/plain;
	charset="iso-8859-1"

You should be able to use javascript and the opener feature to target items
on parent window.

maybe something like

function postdata() {
		
		var oldval = top.opener.document.f1.MyText.value;
		top.opener.document.f1.MyText.value = "";
		top.opener.document.f1.MyText.value = oldval +
document.f2.MyText.value;
		oldval = "";
		
	}

hope that helps

Dave


-----Original Message-----
From: Christopher Cote [mailto:cotec@s...]
Sent: Thursday, March 21, 2002 9:29 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Child window adds text to parent's textarea


I have another sticky problem.  I have a form in which user can type 
information into a textarea.  They can also click a button and make 
another child form appear where they can add items to a table.  This table 
should then be added to what the user has typed in the main (parent) 
page.  This is the part I'm stuck on.  How do I have the text that is 
added in the child window added to the text in the parent page?  I am 
using 2 ASP pages where the child window is popped up with a querystring, 
if that matters.  I have never worked with this functionality before so if 
somebody could please explain the solution completely for me, I'd 
appreciate it.

Thank you in advance,
Chris

Message #3 by dont worry <aspmailbox@y...> on Thu, 21 Mar 2002 09:39:25 -0800 (PST)
If I have a pop up box write text into the main page
and create some hidden form inputs will the main page
need to reload for this, using the javascript below?

--- "Debreceni, David" <Debreceni.David@h...>
wrote:
> You should be able to use javascript and the opener
> feature to target items
> on parent window.
> 
> maybe something like
> 
> function postdata() {
> 		
> 		var oldval = top.opener.document.f1.MyText.value;
> 		top.opener.document.f1.MyText.value = "";
> 		top.opener.document.f1.MyText.value = oldval +
> document.f2.MyText.value;
> 		oldval = "";
> 		
> 	}
> 
> hope that helps
> 
> Dave
> 
> 
> -----Original Message-----
> From: Christopher Cote [mailto:cotec@s...]
> Sent: Thursday, March 21, 2002 9:29 AM
> To: ASP Web HowTo
> Subject: [asp_web_howto] Child window adds text to
> parent's textarea
> 
> 
> I have another sticky problem.  I have a form in
> which user can type 
> information into a textarea.  They can also click a
> button and make 
> another child form appear where they can add items
> to a table.  This table 
> should then be added to what the user has typed in
> the main (parent) 
> page.  This is the part I'm stuck on.  How do I have
> the text that is 
> added in the child window added to the text in the
> parent page?  I am 
> using 2 ASP pages where the child window is popped
> up with a querystring, 
> if that matters.  I have never worked with this
> functionality before so if 
> somebody could please explain the solution
> completely for me, I'd 
> appreciate it.
> 
> Thank you in advance,
> Chris
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/
Message #4 by "Debreceni, David" <Debreceni.David@h...> on Thu, 21 Mar 2002 12:50:22 -0500
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C1D100.DFCC5500
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

no javascript will automatically put the  values on the page with out a
refresh, I have never tried it with hidden values though, from one page 
to
another.  But it should work.  Let me know if it doesn't.  Thanks

Dave

-----Original Message-----
From: dont worry [mailto:aspmailbox@y...]
Sent: Thursday, March 21, 2002 12:39 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: Child window adds text to parent's 
textarea


If I have a pop up box write text into the main page
and create some hidden form inputs will the main page
need to reload for this, using the javascript below?

--- "Debreceni, David" <Debreceni.David@h...>
wrote:
> You should be able to use javascript and the opener
> feature to target items
> on parent window.
>
> maybe something like
>
> function postdata() {
> 	=09
> 		var oldval =3D top.opener.document.f1.MyText.value;
> 		top.opener.document.f1.MyText.value =3D "";
> 		top.opener.document.f1.MyText.value =3D oldval +
> document.f2.MyText.value;
> 		oldval =3D "";
> 	=09
> 	}
>
> hope that helps
>
> Dave
>
>
> -----Original Message-----
> From: Christopher Cote [mailto:cotec@s...]
> Sent: Thursday, March 21, 2002 9:29 AM
> To: ASP Web HowTo
> Subject: [asp_web_howto] Child window adds text to
> parent's textarea
>
>
> I have another sticky problem.  I have a form in
> which user can type
> information into a textarea.  They can also click a
> button and make
> another child form appear where they can add items
> to a table.  This table
> should then be added to what the user has typed in
> the main (parent)
> page.  This is the part I'm stuck on.  How do I have
> the text that is
> added in the child window added to the text in the
> parent page?  I am
> using 2 ASP pages where the child window is popped
> up with a querystring,
> if that matters.  I have never worked with this
> functionality before so if
> somebody could please explain the solution
> completely for me, I'd
> appreciate it.
>
> Thank you in advance,
> Chris
>
>
>


__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards=AE
http://movies.yahoo.com/


Message #5 by "Tim Morford" <tmorford@n...> on Thu, 21 Mar 2002 13:40:30 -0500
Here is an example
<---------------------------- function to open pop-up ----------->
<script language="JavaScript"><!--
function myopen(filename,windowname,properties) {
    msgWindow=open(filename,windowname,properties);
    if (msgWindow.opener == null) msgWindow.opener = self;
	//document.write(self.name);
}
//--></script>
<--------------------------END---------------------------------->


<-----main window------------------------------------->
<A
HREF="javascript:myopen('pop-up.asp','Popwindow','toolbar=no,location=no,dir
ectories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=n
o,width=500,height=300')">NAICS Code</a>
<--------------------------END---------------------------------->

<-----------------------Input box on main window--------------->
<INPUT NAME="NAICS">
<--------------------------END---------------------------------->

<-----------------popup page------------------------------------>
Response.Write("<INPUT TYPE=""CHECKBOX"" NAME=""" & RS("code") & """
VALUE=""" & RS("code") & """
onClick=""if(this.checked)if(opener.document.register.NAICS.value)
opener.document.register.NAICS.value = opener.document.register.NAICS.value
+ ',' + this.value; else opener.document.register.NAICS.value 
this.value;"">")
<--------------------------END---------------------------------->


This opens a page with checkboxes, when they check a checkbox it populates
the box named NAICS Have fun with it!

Tim Morford
http://www.aspalliance.com/tmorford

-----Original Message-----
From: Christopher Cote [mailto:cotec@s...]
Sent: Thursday, March 21, 2002 2:29 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Child window adds text to parent's textarea


I have another sticky problem.  I have a form in which user can type
information into a textarea.  They can also click a button and make
another child form appear where they can add items to a table.  This table
should then be added to what the user has typed in the main (parent)
page.  This is the part I'm stuck on.  How do I have the text that is
added in the child window added to the text in the parent page?  I am
using 2 ASP pages where the child window is popped up with a querystring,
if that matters.  I have never worked with this functionality before so if
somebody could please explain the solution completely for me, I'd
appreciate it.

Thank you in advance,
Chris


  Return to Index