Building populated drop down menus (IE Car Make/Model/Year, etc)

Posted on 2007-08-11
Last Modified: 2013-12-13
I am building a form that I need each menu to be populated based on the previous selected menu.  I would liek this to be done without having to refresh the page at each selection.  

The prime example would be to ask for the make of a car (Honda, Toyota, Ford, etc). Then when the user selects Ford, another menu is populated with the Ford models (Escort, F100, Explorer, etc). Then they can choose the specifc type (EX, LT, EB, etc) and continue on down as far as necessary.

I would like this to be in drop down menus, pulling the info from a MySQL databse using PHP, and preferrably run in javascript on the client side.  Thanks fo the help.
Question by:mopar003
    LVL 54

    Expert Comment

    You need something that uses AJAX.  This will allow you to use javascript, the xmlhttp object, server script and DOM to change the page's content without reloading the page.

    One of the best explanations and simplest examples I have found on the net is at  There is also a good explanation on what AJAX is at  The reference site W3Schools has a good section on AJAX at

    The server script is PHP but that isn't the important part of the AJAX process.  If you would like to provide some of your code then I can help you with doing this in your page.  Let me know if you want a general example using PHP.

    Let me know if you have a question or need more info.

    LVL 54

    Accepted Solution

    If you want a general example of using AJAX with a PHP page then you can look at

    LVL 54

    Expert Comment

    I'm glad I could help.  Thanks for the grade, the points and the fun question.


    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
    Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now