Dropdown in CC6

Populate a dropdown in ChronoForms with database values.

Overview

The dropdown was not populating because the read data action was not configured to return key/value pairs and was placed incorrectly in the form flow.
Set the read data action's "Select type" to "Return key/value pairs" and ensure this action is placed before the form display section. Then, set the dropdown's options field to the correct variable.

Answered
kk kkurtz 12 Feb, 2018
I am trying to populate a dropdown on a CC6 form with a field from a table. Not having much luck.

Read function: read_clubs
Model: Clubs Table:tblclubs

fields to retrieve: Clubs.club
remaining fields left in default

In the form fields view:
Label: Select
Name and ID: select24[]
Options: {var:read_clubs}
{var:read_clubs}

Where am I going wrong?

Thanks,
Karen
Max_admin Max_admin 16 Feb, 2018
Answer
Hi Karen,

The "Select type" should be set to "Return key/value pairs" in the read data.

And the "options" in the dropdown should be set to
{var:read_clubs}
And the read data should be BEFORE the display section

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
kk kkurtz 17 Feb, 2018
Thanks! It is working now.

Karen
This topic is locked and no more replies can be posted.