Ik wil in een pop-up window de waarde lezen van een variabele in een ander window. Ik neem aan dat dat via formulieren moet. In dezelfde pagina lukt het probleemloos om de waarde van het ene formulier naar het andere te kopieren, maar tussen verschillende windows lukt het niet.
Dit is het top-window:
Dit het child-window (child.html)
Ik zie niet wat ik hier fout doe. Iemand een suggestie?
Dit is het top-window:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
| <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
<!--
window.name = "pw";
function OpenWindow() {
window.open("child.html", "child", "width=300,height=200");
};
document.write(window.name);
//-->
</SCRIPT>
<form name="pf" method="post" action="">
<input type="button" name="pb" value="2345">
<input type="submit" name="Submit" value="Submit" onClick="OpenWindow();">
</form> |
Dit het child-window (child.html)
code:
1
2
3
| <form name="cf" method="post" action=""> <input type="button" name="cb" value="xxxx" onClick="cb.value = top.document.pf.pb.value;"> </form> |
Ik zie niet wat ik hier fout doe. Iemand een suggestie?