Chained select

flyboeing 09 Nov, 2010
Hello all,

I have made a form with various fields, such as text fields and drop down menu (select).
My form contains two drop down menu's: one for countries, the second for airports. In the drop down menu of the countries there is a full list of all countries in the world and in the other drop down menu I have most of the airports of the world (the major ones).

Now I was wondering if it is possible to make a chained drop down menu. In the first menu you select the county, then you only can select the airports that are in that country. So after making a selection of the country, in the second drop down menu then there appears a list of the airports in that country (example below).

For example:
I want to choose one of the airports in the United Kingdom. In the first drop down menu I select United Kingdom. Now I can choose in the second drop down menu only the airports from the UK (London Heathrow, Manchester, Glasgow, etc).

I hope someone can help me with this problem.

Kind regards,
Ruud
GreyHead 09 Nov, 2010
Hi Ruud,

I'm just about to go away for a week so no time for a long reply.

For $3 you can get the Ajax answer here; or for free there's an example using option groups here.

Frankly for the size of list you have the Ajax solution is the better one.

Bob
flyboeing 15 Nov, 2010
Thank you for you reply.
I've got it working now. I found a script on the internet and changed some values so it will work in my form. Now I have a chained select, which is getting data from the mysql database.
This topic is locked and no more replies can be posted.