Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to pass value from main window to select window?

Status
Not open for further replies.

alfalf

Programmer
Joined
Mar 6, 2003
Messages
155
Location
BA
Hello.

I have probabilly most common problem here.

I have an search page and Country select box and City text box on it.
Also, on this search page I have a link wich opens all larger cities in country selected, and by using city prefix letters provided, on smaller window.

Problem: How do I get values from search page onto small select window opened from link with this conditions:

1. User selects country from select list (name="country"),
2. User enters first or few first letters of city,
2. User cliks on List hyperlink,
3. Search page stays,
4. javascript opens new small window like:
<a href=&quot;javascript:StartScr(' /*StartScr is function for invoking smaller window*/
5. I want to use on this smaller window selected country index and city prefix characters,
6. And viceversa, how to pass a selected city Name using ID (from list on this smaller window) to search page (like <a class='linkco' href='select_city.php?cmd=city&ID=$aID'>$aID</a>?
7. Both search page and select_city.php I have all finished, but this problem.

Is this solvable with PHP at all?

:-)
Perhaps there's some class for this thing?
Thanks for any suggestions.
 
1. You cannot pass any value back to a page in the browser using PHP without refreshing the page.
2. You could use JavaScript to do it, however, then you rely on the browser's JavaScript capabilities that may be on or off.

The little popup is easy. You just have to append the selected countryID as a GET parameter to thye URL of the window opening function.

After that you can refresh the main search window using exactly the code you have in #6. The only thing to add is target=&quot;parent&quot; -> this refreshes the parent window with the given URL and parameters.

This is more a JavaScript question than PHP. But a mixture will allow you to complete your task.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top