
June 6th, 2000, 11:14 PM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
Defintely possible. I'd store each group of cities in a seperate array, $state1,$state2, etc. Then have a function call with switch statements for each array, if $state1 then echo all elements of the array to the second form list box (or set a second array which gets echoed later in between the html code). When the first drop down box is selected, the page will have to refresh (in other words, the form action will need to call itself) and the second drop down will then show correct cities. This avoids using javascript which since I'm not familiar with, this is how I would do it. (without a database)
You may want to hook this to a database if you have access and have two tables. When you access the appropriate state, you can fetch array (I believe) and get all the cities with that state code. Then it's easy, but you need database access.
------------------
[This message has been edited by Dave Bryant (edited June 06, 2000).]
|