Forum Moderators: open

Message Too Old, No Replies

Value pass to Pop-up Windows

         

Tired Programmer

1:42 pm on Aug 2, 2006 (gmt 0)

10+ Year Member



I have a difficult to past the value of a form to another pop-up windows.

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'];
?>

httpwebwitch

3:36 am on Aug 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



sloppy quotes

try this

window.open('domain.php?domain_name3=' + txtval,id,'width=350,height=375,screenX=200,screenY=300,scrollbars=auto');

sgeorge

6:37 pm on Aug 5, 2006 (gmt 0)

10+ Year Member


I suggest using the window.opener property:

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>