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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dropdown menu which populates another dropdown menu

Status
Not open for further replies.

pendle666

Technical User
Jan 30, 2003
295
GB
Hello

On my webpage I want to have a dropdown list - containing some placenames eg:

London
Birmingham
Manchester
Leeds

and when a person selects, say London, a second dropdown menu gives the following options

Newham
Islington
Deptford
Paddington


Can this be done? I've got some regular dropdown menus available which the visitor can use to search my database, but my new tables are a little more complicated

thanks

Pendle
 
Pendle, you might be able to use the same mechanism I use in this FAQ on the JavaScript section:


That's doing it on the Client-side, if you've got a somewhat reasonable number of placenames (because you need a separate drop-down list for each placename).

If, however, you have a situation where you have a changing list of placenames, and each placename's "neighborhood" menu also changes, then I think you are going to have to implement a server-side solution that produces your web page dynamically.

This might help:

Client-side solution
Pro: Fast as Captain Slickery!
Con: A pain to update if the data changes often.

Server-side solution
Pro: Automatically updates when you update the database online
Con: A lot more work to set up and slower response to the Client, because of the repeated calls to the db.

Does that help at all?

Cheers,


[monkey] Edward [monkey]

"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
Looks like an ideal candidate for AJAX. Have a look in forum1600 as you can get the power and flexibility of a server db solution with the speed of a client solution, particularly if there is a substantial amount of data in total.

If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Google "Dynamic Dependent Dropdowns" for tons of references.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top