CF8 Table with dynamic dropdowns + database read

populate a dynamic table with dropdowns from a database in ChronoForms.

Overview

The user needs to display multiple rows from an assignments table in a form, with each row's data populating dynamic dropdowns for pos_id and user_id.
First, use a PHP action to read the assignments data and build an array. Then, use that array to set the dynamic options for the dropdown fields as outlined in the CF tutorial on dynamic options.

Answered
ChronoForms v8
bb bbaraba 08 Aug, 2025

Hi all,

I need a solution for this idea:

  1. I have a table "assignments" with 2 fields: pos_id, user_id
  2. I need a table on my form which displays the dropdowns for both fields with the data stored in the database.
  3. The user id possible values are from the users table (jos_users or its name), the pos_id is from my custom table (positions)

Is there any way to achieve it?

And of course a submit button with save into database would be good as well.

bb bbaraba 11 Aug, 2025

Thank you for your answer, I know how to fill up data for dropdown options. What i really need is to read data from the "assignments" table first and populate its values (it can be 1 to 8 rows). to lines with dropdowns for pos_id and user_id (stored in the assignments table)

Max_admin Max_admin 11 Aug, 2025

You can read the data then:

1- use PHP in a PHP actions to create your own array then:

2- use that array for the options in the Dropdown

#2- is explained in the tutorial I linked before, do you need help with #1 ?

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