CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 referring to child window from parent

Print topic Send  topic

Author Message
CodeChargenewbie

Posts: 114
Posted: 01/28/2008, 6:07 AM

I know how to refer to the parent window from the child? That's straight forward and there are numerous resources on the web on said topic. But what I am having trouble with is referring to child window datat from the parent window itself. Say I have a form control value on the child window; let's call it Child_control. How can I refer to this control in the parent's window javascript? Maybe I want to use alert to see its value or set its value to something, again, from inside the parent window. Is this possible to do???

This is what I have right now and it doesn't work. I defined a global javascript variable called test in the header of the child window and set it to a string value of "this works" (without quotes). So, it looks like this:

child window
-----------------
<html>
<head>
...
<script language="javascript" type="text/javascript">
var test = "this works";
</script>

I want to print this value from the parent window. Better yet, I'd like to change it's value from the parent window and then print it to confirm that the variable was set to something else.

This is what I have in the parent window that doesnt' seem to work:

parent window
--------------------
//inside of a function call

var win;
win = window.open("PopUptest.php", "Test", "height=240, width = 320, toolbar=no, scrollbars=yes, menubar=no");
win.focus();

//Up to here, it opens, focuses, and works fine

alert(win.test); // tells me "undefined" (without quotes)

What am I doing wrong here? Nevermind trying to manipulate a child's form control from the parent window. I just want to print the child's global javascript variable from the parent window. There must be a way to do this.

Thank you.
View profile  Send private message
Edd


Posts: 547
Posted: 01/29/2008, 12:28 PM

See the following post

http://forums.codecharge.com/posts.php?post_id=93160

Cheers - Edd
_________________
Accepting and instigating change are life's challenges.

http://www.syntech.com.au
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.