Open window2 (javascript), enter info in a form, then close window2 and refresh window1. help.
| From: | Matthew DeChant | Date: | Thu, 26 Jul 2001 16:46:01 +0000 |
| Subject: | Open window2 (javascript), enter info in a form, then close window2 and refresh window1. help. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-59786@lists.php.net to get a copy of this message | ||
I've gotten this far:
URL to open an advanced search window(window2) from window1:
<a href=\"javascript:newWindow =
window.open('db_viewMD.php?dsn=$dsn&db=$db&lm=$lm&advsrch=true','advsrch','h
eight=$vsize,width=310,scrollbars=$bln,resizeable=yes');
newWindow.focus()\")>Advanced Search</a>
Enter text in a form (snippet from form, close window if cancel is clicked,
redirect window1 to new url, close window):
print "<form name=advsrch method=post action=db_viewMD.php>";
print "<td class=sansbold>field1</td>\n";
print "<td class=sansbold><input type=text
name=field1></td></tr>\n";
print "<input type=submit value=Submit
onclick=window.opener.location='db_viewMD.php?';self.close()>\n";
print "<input type=button value=Cancel onclick=self.close()>\n";
Now the problem is that redirecting window1 isn't really helpful because the
form variables don't get loaded to window1 unless they are part of the URL
(ie. dbview_md.php?field1=textentered1&field2=textentered2) but they can't
be part of the URL because you don't know the text entered in the form until
it submits the form.)
Is there a way to just refresh window1 after changing the PHP variable
(HTTP_SERVER_VARS["argv"]??) that holds the arguments for window1?
-m