nadia wrote:
Is it possible to do the following in php:
I want to have a main form open. In the form I want a button that will
open a popup window so the user can search for something. The user can
then select what they want, and the popup window closes and the main
form (which is still open) shows the search results.
Can anyone suggest a best course of action to acheive this?
Thanks
You'll need a bit of javascript in there as well.
The simplest way is probably to get the results page to take an optional
search parameter. All the popup has to do then is do the following:
<script language="javascript">
function search() {
var searchstring;
// get search parameters into searchstring
window.opener.location.href = 'resultspage.php?' + searchstring;
window.close();
}
<form onSubmit='search()'>
<!-- actual search form -->
</form>