Re: Opening new browser window

From: Date: Thu, 18 Sep 2003 18:59:37 +0000
Subject: Re: Opening new browser window
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-163202@lists.php.net to get a copy of this message
Rich Fox said the following on 9/19/2003 12:33 PM>>
I would like to open a new browser window from within my php script (edit.php), a window in which another php page is run (search.php). search.php should be able to receive $_POST vars etc. from edit.php. I am not sure that the javascript solution to popup a window is correct, because then the popup does not behave normally. By normally, I mean that when I use javascript to popup a new window (search.php), and in search.php I have a form <form action="searchAction.php" method=post> <input type=hidden name=caller value=window.opener.location.href> window is a javascript object and so you should be calling some javascript function to set the value here, something like
<body onload = "setvalue()"> <script> document.form.caller.value=window.opener.location.href; </script>
 <input type=hidden name=ID       value=<? $_GET['ID'] ?> >
 <input type=hidden name=Type       value=<? $type?> >
 <input type=button name=btnOK    value=OK>
<input type=button name=btnCancel value=Cancel> </form> clicking OK or Cancel does absolutely nothing. So, I would like to avoid javascript and simply open a new browser window to run search.php. What is the accepted way to do this in php?
btnOK and btnCancel are not instructed to do anything when clicked and so there's nothing wrong they are doing! what work these two buttons are supposed to do? I assume 1. btnOK is to post the data to server? in that case, you should have it as button=submit or an onClick="javascript function()"? 2. btnCancel is to close the window and go back to the parent page? in that case also, you should have a onClick function. HTH R'twick

« previous php.general (#163202) next »