Please help with interacting windows

D

Dmitri

Here is my simplefied example, I need that when one of radio buttons
is selected the color in original window of label "color" will became
different color. Where is my mistake?
here is code for window original window:

<html>
<head><TITLE>Help</TITLE>
<script>
var w;
function f1()
{
w=open("color.html","window2");
if(w.opener==null) w.opener=self;
}
</script>
</head>
<BODY>
<font color="#FF0000" name="lol">color</font>
<input type="button" value="new window" onClick="f1()">
</BODY>
</html>

And here is code for second window:
<html>
<head><TITLE>Help</TITLE>
<script>
var w;
function f2(form)
{
for(i=0;i<2;i++)
{
if(form.cc.checked)
{
break;
}
}
opener.document.lol.color= form.cc.value;
}
</script>
</head>
<BODY>
<form>
<input type="radio" name="cc" value="#00FF00"
onClick="f2(form)">GREEN!<br>
<input type="radio" name="cc" value="#0000FF" onClick="f2(form)">BLUE!
</form>

</BODY>
</html>

Please help.
Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Please Help? 0
Help with code 0
Help please 8
I dont get this. Please help me!! 2
Help me sort out this script 1
"input-group-text" help 7
Help with Visual Lightbox: Scripts 2
Need help with stripe payment 0

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top