|
-
Mar 27th, 2002, 09:10 AM
#1
Thread Starter
Hyperactive Member
Pass a value to a parent window??
I have a frame page that has a page in the "main" frame. The page in the main frame has a form. On this form there are buttons and text boxes. When I click a button a new window opens. This window has a form with buttons and text boxes.
When I click on a button on the new window i want to pass a value to a textbox on the old window.
How do I do this???
/Smirre
Visual Basic
C, C++
Java
Access
SQL Server
MCP, MCSD
-
Mar 27th, 2002, 09:48 AM
#2
Thread Starter
Hyperactive Member
Visual Basic
C, C++
Java
Access
SQL Server
MCP, MCSD
-
Mar 27th, 2002, 09:52 AM
#3
Fanatic Member
Try this : -
Code For Window 1 (Parent Window)
Code:
<head>
<title>Page1</title>
</head>
<script language="JavaScript" type="text/javascript">
<!--
function popup(){
win = window.open('2.htm');
win.creator = self;
}
//-->
</script>
<body>
<form name="form1">
<input type="text" name="text1">
<input type="button" value="Popup" onclick="popup()">
</form>
</body>
</html>
Code For Window 2 (Child Window)
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Page2</title>
<script type="text/javascript" language="javascript">
function passBack(){
creator.document.form1.text1.value = document.form2.text2.value;
}
</script>
</head>
<body>
<form name="form2">
<input type="button" value="Pass Value" onclick="passBack()">
<input type="text" name="text2">
</form>
</body>
</html>
-
Mar 27th, 2002, 09:54 AM
#4
Fanatic Member
Sorry, I must've been writing while you solved it
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|