By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,303 Members | 1,245 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,303 IT Pros & Developers. It's quick & easy.

Dependent Drop Down Menus 3 deep

P: 1
Ugh .. You woudn't think this would be a challange - but I've been through searching everywhere and tried three different things and nothing works.

I need a dependant drop down menu ... (PHP code)

MAKE (Chevy, Toyota etc)

MODEL (list of models depending on selected above)

YEAR - list of years - depending on above two selections

Now client doesn't want to "submit" after each selection so it has to be something that updates automatically. So probably js or AJAX.

Problem is - I can get one level down (Make/model) but not the third. Also in the one method where I really do get the third to list ... there is no way to capture what was saved in Make/Model to pass to the next page.

I don't want to just spit back what was selected - I need to take the three variables and pull information from a shopping cart catalog and display all that.

Has anyone successfully done this ? Obviously someone has .. but I can't figure out all the pieces. It's not as easy as I though !

Any info - or point me to something new.

Thanks

Donna
Mar 2 '08 #1
Share this Question
Share on Google+
4 Replies


dlite922
Expert 100+
P: 1,584
Ugh .. You woudn't think this would be a challange - but I've been through searching everywhere and tried three different things and nothing works.

I need a dependant drop down menu ... (PHP code)

MAKE (Chevy, Toyota etc)

MODEL (list of models depending on selected above)

YEAR - list of years - depending on above two selections

Now client doesn't want to "submit" after each selection so it has to be something that updates automatically. So probably js or AJAX.

Problem is - I can get one level down (Make/model) but not the third. Also in the one method where I really do get the third to list ... there is no way to capture what was saved in Make/Model to pass to the next page.

I don't want to just spit back what was selected - I need to take the three variables and pull information from a shopping cart catalog and display all that.

Has anyone successfully done this ? Obviously someone has .. but I can't figure out all the pieces. It's not as easy as I though !

Any info - or point me to something new.

Thanks

Donna
I'm actually about to do something like this myself. But from what i've seen in most sites, they usually select the year first, or second, not last. Reason is, some models don't exists some years.

Besides that fact, what i would do is three all peice of information with AJAX.

On the Server side grab each one, if NOT blank, add it in the WHERE clause.

Then return the results in XML format something probably like this:

<makes>
<make>Chevy</make>
<make>Honday</make>
etc
</makes>
<models>
<model>HX</model>

</models>
<years>
<year>2000</year>
<year>1999</year>
</years>


Of course that's what it will look like after the second drop down. The first time the year would be empty until you select a model. Initially you want to have all the Makes listed to start with.

It is easy to do. maybe you're looking too much into it. I'll never know until i'll complete it myself.
Mar 2 '08 #2

hsriat
Expert 100+
P: 1,654
Challenge!!!!!!!!?????? ...... :D

Clever way to provoke guys out here to write code for you.

But I guess along what dlite922 has advised you, you can check this link out.
Mar 2 '08 #3

dlite922
Expert 100+
P: 1,584
Challenge!!!!!!!!?????? ...... :D

Clever way to provoke guys out here to write code for you.

But I guess along what dlite922 has advised you, you can check this link out.
honestly, its not that bad, i've seen way worse. The title implies, but the body says , point me in the right direction.

It is kinda too much to ask to write the whole AJAX app for him. If he's tacking AJAX and application this big, i think he knows code well enough that if we tell him what to do, he can figure itout.

W3Schools is a great website.

I totally agree he's lacking in the AJAX department.
Mar 2 '08 #4

ronverdonk
Expert 2.5K+
P: 4,258
When you are looking for good tutorials, here are 2:
1. Universal Related Popup Menus
for a more general tutorial about related popups. and

2. Universally Related Popup Menus AJAX Edition
for a specific Ajax implementation of drop downs working towards an implementation of your request (i.e. car manufactorer -> model -> model level).

Have fun.

Ronald
Mar 2 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.