Welcome to WebmasterWorld Guest from 18.204.48.199

Forum Moderators: open

Message Too Old, No Replies

tranfer data

     

override

4:48 pm on Jan 3, 2004 (gmt 0)

Inactive Member
Account Expired

 
 


hey,

I want to make a page that i keep open,
and if a users presses the ok button on another page, the value of a txt on that page appears in the txt of the page I keep open.

Is this possible using javascript?

4:47 pm on Jan 8, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 8, 2004
posts:162
votes: 0


override,

You can do this if one of the windows opened the other.

Let's suppose that you have a page called js_opener.htm that contains a function to open another page called js_opened.htm:

<script type="text/javascript">
<!--
//initialize myWindow as a global variable
var myWindow

//myFunction opens a new window
function myFunction(){
myWindow=window.open('js_opened.htm')
}

//-->
</script>

Once the function has been called and the page opened, you have a variable reference to the window. This means that you could have code like:

myWindow.document.forms[0].myTextbox.value='Hello!'

on js_opener.htm which would set the value of the myTextbox object on js_opened.htm.

Conversely, you can have the opened page act upon the opening page using the 'opener' reference.

From the opened page, you can have code like:

window.opener.document.forms[0].myOpenerPageTextbox.value='Hey, this works!'

which would set the value of the myOpenerPageTextbox object on js_opener.htm.

Hope this helps!

ajkimoto