Help - Search - Members - Calendar
Full Version: Dependent Dropdowns WITHOUT a database
HTMLHelp Forums > Programming > Databases
langba
HTML experience level: intermediate. CSS experience: beginner. Database experience: none.

I need to create a dependent dropdown five levels deep without the help of MySQL, PHP, Perl, etc. The first dropdown is the type of information one is looking for, then dropdown #2-4 is country, state, then city. The fifth will be a text window that reports any number of unique items after the city is determined.

I either need to do this *gulp* in the html code or pulled from a delimited text file. The text file might look like this, where info1 is about the first 3 locations and info2 is about the other two locations (note: I picked the locations at random):


info1.....US........Florida...Miami.....unique1...
info1.....US........CaliforniaOakland...unique2...
info1.....France....Quebec....Quebec....unique3...
info2.....US........New.York..Buffalo...unique4...
info2.....Germany...Hessen....Wiesbaden.unique5...


The dropdowns would pull from 11-20, 21-30 etc. based on unique entries found in 1-10. Can you just imaging database.txt? One step forward, ten steps back.

There could be thousands of lines. I could break up the external files by info1, info2, etc.

You are probably LYAO or will reply like this, "It would be easier if you would instead decide to be a garbageman!"

I thought I was up to the challenge, but I keep hitting road blocks. It seems easy enough to post to a variety of forms, just not export from the same.

Any ideas are forever greatly appreciated.
Brian Chandler
What do you mean by a "dropdown"?

Anything you can generate in php using a database can be generated without a database, by using the same information in a different form (e.g. a flat text file) - it just makes it a lot more work. So if you like work, it might be the answer.
langba
Sorry if my terminology is a little off. I am self-taught. I guess dropdown applies more to dhtml menus. Should I say listbox or combobox?

What I mean by dropdown is the type you see on sites like cars.com. In the "Buy" section, first you select "Acura", then the second dropdown populates, and so on.
Darin McGrew
Those are select elements.

The HTML is easy. The hard part is the programming that generates the second select element based on the option chosen for the first one, that generates the third select element based on the option chosen for the second one, and so on.
Brian Chandler
You probably want some javascript to do this - nothing directly to do with databases.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.