Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: sending values from one form to another


Message #1 by "Priya" <priya_sivaraman2001@y...> on Thu, 30 Jan 2003 08:14:50
Hi priya,
In the second page where u have the table  add this script
<script>
var combobox_value;
var text_value;

combobox_value 
window.opener.document.formname.comboboxname[window.opener.document.form
name.comboboxname.selectedIndex].text;
text_value= window.opener.document.formname.textboxname.value;
</script>
<!-- window.opener gives u the handle of the window which had opened it
-->


and in the table when you are filling the table cells write the code in
somewhat this way,,

	<tr>
		<td >
		<b><script>
		document.write(combobox_value);
		</script></b>
		</td>
		<td >
		<b><script>
		document.write(text_value);
		</script></b>
		</td>
	</tr>


hope this solves your problem,
cheers,
Shashi.
-----Original Message-----
From: Priya [mailto:priya_sivaraman2001@y...] 
Sent: Thursday, January 30, 2003 3:34 PM
To: JavaScript HowTo
Subject: [javascript_howto] Re: sending values from one form to another

what exactly happens is i have a form in one window with a button placed

over that form.When i press this button, it will take me to another form

present in a new window.this form has a table and the value in the combo

box & the textbox present in the first form should be sent to the table
in 
the second form.I think now i am clear.

priya   

> 
:)
 Explain exactly how your windows open and I'll explain a little better.



I mean do you have 1 page (with a form)  and you push a button on THAT 
PAGE and it opens a new window with a form on it? OR do you have to 
separate pages opened from other pages??? explain how your pages are 
created please and I can give you a better idea of how to solve your 
problem :)


Keith Bamberger
Programmerare
Plakat AB
Kungsgatan 51
903 26 Ume=E5

0730-37 51 79 mobil
keith@p...

090-71 77 00 v=E4xel
090-71 77 01 fax
www.plakat.se
----- Original Message -----
From: "Priya" <priya_sivaraman2001@y...>
To: "JavaScript HowTo" <javascript_howto@p...>
Sent: Thursday, January 30, 2003 9:25 AM
Subject: [javascript_howto] Re: sending values from one form to another


> my problem is from a combo in one form(of one window)i'll have to pass
> the value to the table in another form of different window,the code u

have
> given is not working properly do u have anyidea regarding the same
>
> > hmm this is a little different.
>
> If 1 page has been opened by another then you can use window.opener 
(Is =3D
> this your current situation?)
>
> So if from Page1 you open a new Window (With the new form in it, and 
you =3D
> want to pass objects back) you can say
> window.opener.FORM1.OBJECT.value=3D3Ddocument.FORM2.OBJECT.VALUE
>
> Priya
>
> Keith Bamberger
> Programmerare
> Plakat AB
> Kungsgatan 51
> 903 26 Ume=3DE5
>
> 0730-37 51 79 mobil
> keith@p...
>
> 090-71 77 00 v=3DE4xel
> 090-71 77 01 fax
> www.plakat.se
> ----- Original Message -----=3D20
> From: "Priya" <priya_sivaraman2001@y...>
> To: "JavaScript HowTo" <javascript_howto@p...>
> Sent: Thursday, January 30, 2003 8:44 AM
> Subject: [javascript_howto] Re: sending values from one form to 
another
>
>
> > hai,
> >  both the forms are in different pages moreover can we use=3D20
> >  the following code to write values from one textbox to another
> > =3D20
> >     newwindow.document1.form1.text1.value =3D3D =3D
> document.form1.nametext.value;
> > =3D20
> > newwindow is the name of the second page
> >=3D20
> >=3D20
> > > Are both the forms on the same page??
> >=3D20
> > if so then from your javascript, you can say =3D3D
> > document.FORM2.OBJECT.value=3D3D3Ddocument.Form1.OBJECT.value
> >=3D20
> > if they are on different pages then you use the Request object to 
get =3D
> =3D3D
> > out posted data to the page. like this
> >=3D20
> > <%
> > if Request("OBJECT") <> "" then
> >     Response.write(Request("OBJECT"))
> > End if
> > %>
> >=3D20
> > when you create your page.
> >=3D20
> > Hope that helps.
> >=3D20
> > Keith Bamberger
> > Programmerare
> > Plakat AB
> > Kungsgatan 51
> > 903 26 Ume=3D3DE5
> >=3D20
> > 0730-37 51 79 mobil
> > keith@p...
> >=3D20
> > 090-71 77 00 v=3D3DE4xel
> > 090-71 77 01 fax
> > www.plakat.se
> > ----- Original Message -----=3D3D20
> > From: "Priya" <priya_sivaraman2001@y...>
> > To: "JavaScript HowTo" <javascript_howto@p...>
> > Sent: Thursday, January 30, 2003 8:14 AM
> > Subject: [javascript_howto] sending values from one form to another
> >=3D20
> >=3D20
> > > hai everybody,
> > > this question may be silly but, i am a beginner how do we send =3D
> values =3D3D
> > from=3D3D20
> > > one form to a table in another form.
> > >=3D3D20
> > > thanks in advance
> > > Priya
> > > ---
> > > Change your mail options at http://p2p.wrox.com/manager.asp 
or=3D3D20
> > > to unsubscribe send a blank email to =3D3D
> > >=3D3D20
> >=3D20
> >=3D20
> > ---
> > Change your mail options at http://p2p.wrox.com/manager.asp or=3D20
> > to unsubscribe send a blank email to =3D
> >=3D20
>
>
>




  Return to Index