window is a javascript object and so you should be calling some javascript function to set the value here, something likeI 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>
<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
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php