Dynamic Dropdown

populate a dynamic dropdown based on another selection in ChronoForms.

Overview

JavaScript-generated options are blocked by CF, and PHP arrays cannot be passed directly to the dropdown field.
Use the built-in CF tutorial for dynamic dropdowns or implement separate dropdowns for each option, showing or hiding them based on the initial selection using listeners.

Answered
ChronoForms v8
Fl Flamingo 03 Jan, 2026

I'm trying to accomplish the classic task of displaying the federal states for selection in a second dropdown field, depending on the country setting in the first dropdown. My first attempt using JavaScript failed because the option list created by the JavaScript was blocked/overwritten by the CF8 field. How can this be prevented? In a second attempt, I created the necessary option arrays from the database using PHP. I haven't found any way to pass these arrays to the dropdown field. How exactly should this be done? Is there a proven example for this task? Thank you very much for any help!

Fl Flamingo 05 Jan, 2026
Answer
1 Likes

Hi Max

Thanks for your feedback. I saw this suggestion. For this relatively simple purpose, it's complicated, and I don't understand how it works with multiple countries.

I've now solved the problem with one dropdown field per country. These are hidden or shown depending on the selected country using listeners. This is also complicated, but transparent and robust.

I can't recommend using JavaScript for this. You have to consider too many CF functions.

Max_admin Max_admin 06 Jan, 2026

Hi Flamingo

Showing/Hiding different dropdowns is also ok, but the solution in the FAQ is more dynamic

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Post a Reply