Forum Moderators: open
There are 2 program (in php) . One is new.php which is the main windows and another doman.php is a pop-up windows.
The value of domain_name2 fail to past to the pop-up windows.
------------- new.php ------------------------
<FORM METHOD=POST ACTION="new.php" name="form1">
<inPUT TYPE="text" NAME="domain_name2" value="">
<inPUT TYPE="button" value="Check Availibity" onclick="openwindow(this.form)">
</form>
<script type="text/javascript">
function openwindow(form){
var txtval = form.domain_name2.value;
var day = new Date();
var id = day.getTime();
alert(txtval);
window.open("domain.php?domain_name3=txtval,id,"width=350,height=375,screenX=200,screenY=300,scrollbars=auto");
}
</script>
----------------- domain.php -------------------
<?php
echo $_GET['domain_name3'];
?>
When a window is opened from another window, it maintains a reference to that first window as window.opener. If the current window has no opener, this method returns NULL.
ie. Place the following in the popup page:
function getvalues()
{
document.form1.domain_name2.value=window.opener.document.form2.domain_name2.value
}
</script>