Help, pop up window


function get_check_value()
{
var c_value = "";
for (var i=0; i < document.callflow.flow.length; i++)
   {
   if (document.callflow.flow[i].checked)
      {
      c_value = c_value + document.callflow.flow[i].value + "\
";
      }
   }
c_value = "You did the following steps:\
" + c_value;
alert(c_value);
return false;
}

Hi,

May I ask how do you display the value of c_value in a pop window, instead of an alert… its been bugging me for a week now…

I dont know how can i do this… i tried window.open() but the code seems incomplete or wrong…

Try passing it to the file that opens in the new window.


function openWindow(){
    	var c_value = 'testparent';
    	window.open('test.php?myval=' + c_value, 'MyWin', 'width=200,height=200');
    }

And in your test.php file you can get it with $_GET[‘myval’] in case of PHP. If you are in different language then you can do accordingly. If you dont want to use server side then you can store the value in a hidden form field in opener window and get it from opening window like this:


function openWindow(){
    	var c_value = 'testparent';
    document.getElementById('test_value').value = c_value;
    	window.open('test.php', 'MyWin', 'width=200,height=200');
    }


<input type="text" name="myTest" id="myTest" value="10000" />
<a href="#" onclick="openWindow();">Click me</a>

And in test.php file.


alert(window.opener.document.getElementById('test_value').value;