|
-
Oct 30th, 2000, 01:13 PM
#1
On a form, I have two drop down selection lists. One is for State and the other is for City. I have a file that holds all the Cities per State. Once the user has selected a state, I would like to load the City list for all cities for the selected state. Can anyone give me some suggestions or examples. THANKS!
-
Oct 30th, 2000, 04:08 PM
#2
Frenzied Member
You can either do it on a refresh of the page using the onchange event for the state dropdown, or you can write all of your data into the page in a script tag using response.writes and a client side array. They put code in the onchange event of the state dropdown that repopulates the city dropdown based on elements of the array that match the criteria selected in the state dropdown.
Depends on what you consider the lesser of two evils:
A large page because lots of data is stored within it will take longer to download but once it is downloaded, is self sufficient to switch states and cities and requires no more round trips to the server (And presumably the database)
Refreshes will occurr quickly, but require another request to the server and another hit to the database. (You would pass back the selection in the state combo to the same page where it is used in the SQL statement to get the city data)
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|