Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-02-2006, 02:04 PM   PM User | #1
JohnnyD
New to the CF scene

 
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
JohnnyD is an unknown quantity at this point
passing value problem

I'm trying to passing values between 2 pages it works when I open page2.html in another frame(mainFrame), but when I want it to open in the same frame(leftFrame) it dosn't work??


Code:
source.html (in leftFrame)

<head>
<script language="JavaScript" type="text/javascript">
<!--

function newWindow(file,window) {
    msgWindow=open(file,window,'');
    if (msgWindow.opener == null) msgWindow.opener = self;
}
//-->
</script>
<body>
<form name="form1a" id="form1a">
    <input name="textfield" type="text" value="10" />
    <input name="textfield2" type="text" value="20" />

    <input type="button" value="Open New Window" onClick="newWindow('page2.html','leftFrame')">
</form>
</body>


page2.html( to open in the same frame)
<head>
<script language="JavaScript"><!--
var etta = opener.document.form1a.textfield.value;
var tvoa = opener.document.form1a.textfield2.value;
function value() {
   
	document.form1.textfield.value=etta;
	document.form1.textfield2.value=tvoa;
  
  }
//--></script>


</head>

<body onload="value()">
<form id="form1" name="form1" method="post" action="">
  <input name="textfield" type="text" readonly="1" />
  <input name="textfield2" type="text" readonly="1" />
</form>


</body>

Last edited by JohnnyD; 05-02-2006 at 05:33 PM..
JohnnyD is offline   Reply With Quote
Old 05-02-2006, 08:24 PM   PM User | #2
Mr J
Senior Coder

 
Join Date: Aug 2002
Location: UK
Posts: 2,789
Thanks: 2
Thanked 14 Times in 14 Posts
Mr J is on a distinguished road
To open in the same window you would probably have to use the query string

The information here may help you.

http://www.huntingground.freeserve.c...ta/p_data1.htm
__________________
The silent one.

The most dangerous thing in the world is an idea.
The most dangerous person in the world is the one with an idea.
Mr J is offline   Reply With Quote
Old 05-02-2006, 09:10 PM   PM User | #3
JohnnyD
New to the CF scene

 
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
JohnnyD is an unknown quantity at this point
Thumbs up



Thank you MR J

I belive that will help me.

You saved my day

JohnnyD
JohnnyD is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:20 AM.


Advertisement
Log in to turn off these ads.