parent-child window in java script
<p>i want to stop the program flow until i receive input from child window.</p>

<p>code for parent window:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=windows-1252"&gt;
&lt;title&gt;MainPage&lt;/title&gt;
&lt;SCRIPT LANGUAGE="JavaScript"&gt;

function openpage(){
window.open("ok.htm","Warning",'fullscreen=0,height=150,width=300,left=500,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,top=200');

//this the place i want my program to wait till i get any  input that is any change in document.fm.w.value form my child window///////
alert(document.fm.w.value);/// alert should contain the new value acorrding to selection of button in child window////

 }
&lt;/SCRIPT&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form name="fm"&gt; 
&lt;input type="hidden" size="40" id="w" value="wwww"&gt;
&lt;input type="button" value= "press" id="q" name= "q" onclick= "openpage();"&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Child window code:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=windows-1252"&gt;
&lt;title&gt;Warning&lt;/title&gt;
&lt;SCRIPT LANGUAGE="JavaScript"&gt;

function ReturnToMainPage1() {
window.opener.document.fm.w.value = "X"
//self.close();
}
function ReturnToMainPage2() {
window.opener.document.fm.w.value = "O"
self.close();
}

&lt;/SCRIPT&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form name="fm"&gt; 
&lt;table id="MessageTable" width="100%"&gt;
    &lt;tr&gt;
        &lt;td align="center"&gt;
        &lt;input type="button" value= "OK" id="Latest_Version" onclick= "ReturnToMainPage1();"&gt;&lt;/td&gt;
        &lt;td&gt;View Latest Released Version&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td align="center"&gt;&lt;input type="button" value= "OK" id="Older_Version" onclick= "ReturnToMainPage2();"&gt;&lt;/td&gt;
        &lt;td&gt;Continue Viewing Obsolete Version&lt;/td&gt;
    &lt;/tr&gt;

&lt;/table&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
