Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Create drop down based on drop down

Participant ,
Dec 11, 2008 Dec 11, 2008
Lets say I have a table that contains 50 states and I query and produce a dynamic drop down list. Is it possible to create another dynamic drop down list based on a selection from the first drop down list (both have to be on the same form) ?

For example, if I select TX from the states drop down, then the second drop down, which is city, should show me a list of cities in TX, as a drop down. If I select NY from states, then the city would show cities in NY as a drop down, etc. The city dropdown should change dynamically based on the state drop down selection.

How can this be done ?
460
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 11, 2008 Dec 11, 2008
The concept is called related selects and there is a lot of information available. However, it might not be the best idea in this case, depending on how many cities you are talking about.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 11, 2008 Dec 11, 2008
Well, you can do this with CF for sure, but because you'd probably want to populate the second select list "onChange" this will mean JavaScript would be required (or you could have a submit button I suppose). But, if you're gonna use JavaScript, then you may aswell use AJAX which would be nicer.

Search Google for help on specifics. It's called "chained selects" or "related selects". I think there also used to be a custom tag for it out there somewhere too.

Good luck,
Mikey,
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 11, 2008 Dec 11, 2008
LATEST
Also,

You can use DOM/WDDX stuff to acheieve this.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources