Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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

Posted on 2007-08-11
Medium Priority
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
  • 3
LVL 54

Expert Comment

ID: 19677535
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 http://www.skeymedia.com/programming/classic-asp-and-ajax-tutorial/.  There is also a good explanation on what AJAX is at http://en.wikipedia.org/wiki/Ajax_%28programming%29.  The reference site W3Schools has a good section on AJAX at http://www.w3schools.com/ajax/default.asp.

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

b0lsc0tt earned 2000 total points
ID: 19677553
If you want a general example of using AJAX with a PHP page then you can look at http://www.experts-exchange.com/Database/MySQL/Q_22715336.html#19580584.

LVL 54

Expert Comment

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


Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

564 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