Hello everyone - Rather large question here having to deal with communication between windows with js.
Here is the code first. (Cleaned for question)
(Parent Page)
--------------
<html>
<head>
<title>Bid Opps</title>
<script language="javascript">
function div2win() {
window.open('pop/div2.htm','divPop','width=900,height=480,scrollbars=yes');
}
</script>
</head>
<body>
<form name=bidForm>
<a href="javascript:div2win();">Division 2</a><br>
<textarea name="div2Box"></textarea>
</form>
</body>
</html>
--------------
(Child Page)
--------------
<html>
<head>
<title>Division 2 Listing</title>
<script language=javascript>
function div2Value(){
window.opener.bidForm.div2Box.value = document.division2.value;
}
</script>
</head>
<body>
<form name=division2>
<input type="checkbox" name="100" value="100">100<br>
<input type="checkbox" name="200" value="200">200<br>
<input type="checkbox" name="300" value="300">300<br>
<input type=submit value="Submit and Close Window" onClick="div2Value(); + window.close();" >
</form>
</body>
</html>
--------------
Essentially the user will be able to click on a link on the Parent Page to open a new window (child page) and choose, from checkboxes, different specializations.
However, when clicking on the Submit button (child page-after choosing specializations) the Parent Window "div2Box" field returns with "undefined" in the text area.
Is there anyway for the Child Page to send back an array of data and post it into that "div2Box" text area on the Parent Page?
Any help would be wonderful. =)
Thank you all - Please let me know if I'm being unclear...Hopefully, I can clear it up if it seems to convoluted.
Here is the code first. (Cleaned for question)
(Parent Page)
--------------
<html>
<head>
<title>Bid Opps</title>
<script language="javascript">
function div2win() {
window.open('pop/div2.htm','divPop','width=900,height=480,scrollbars=yes');
}
</script>
</head>
<body>
<form name=bidForm>
<a href="javascript:div2win();">Division 2</a><br>
<textarea name="div2Box"></textarea>
</form>
</body>
</html>
--------------
(Child Page)
--------------
<html>
<head>
<title>Division 2 Listing</title>
<script language=javascript>
function div2Value(){
window.opener.bidForm.div2Box.value = document.division2.value;
}
</script>
</head>
<body>
<form name=division2>
<input type="checkbox" name="100" value="100">100<br>
<input type="checkbox" name="200" value="200">200<br>
<input type="checkbox" name="300" value="300">300<br>
<input type=submit value="Submit and Close Window" onClick="div2Value(); + window.close();" >
</form>
</body>
</html>
--------------
Essentially the user will be able to click on a link on the Parent Page to open a new window (child page) and choose, from checkboxes, different specializations.
However, when clicking on the Submit button (child page-after choosing specializations) the Parent Window "div2Box" field returns with "undefined" in the text area.
Is there anyway for the Child Page to send back an array of data and post it into that "div2Box" text area on the Parent Page?
Any help would be wonderful. =)
Thank you all - Please let me know if I'm being unclear...Hopefully, I can clear it up if it seems to convoluted.