populating a dropdown with JEvent entries

Populate a dropdown with JEvents entries in ChronoForms 8.

Overview

The issue occurs because the custom database query method used in CF7 is not compatible with CF8.
Use the new Read Data function in CF8 with a Where Statement to select records, then connect the output to the Dynamic Options of the dropdown field.

Answered
ChronoForms v8
ty typomaniac 08 Jul, 2025

Dear all,

in CF 7, I use the below script to populate a dropdown with specific entries from JEvents. This works smooth and fine for years now on this site: https://pdh.ch/index.php/de/agenda

Now I installed CF8 on a J5 site and tried to use the same logic. But the db entries are not showing up:

$current_day = JFactory::getDate('+0 seconds');$current_day = $current_day->toUnix();$options = array();$db =& JFactory::getDBO();$query = "SELECT    #__jevents_vevdetail.dtstart,     #__jevents_vevdetail.summaryFROM #__jevents_vevdetailINNER JOIN #__jevents_vevent ON #__jevents_vevdetail.evdet_id = #__jevents_vevent.detail_idWHERE    #__jevents_vevdetail.dtstart > " . $current_day ." AND    #__jevents_vevent.access = 1 AND    #__jevents_vevent.state >= 1order by #__jevents_vevdetail.dtstart;";$db->setQuery($query);return $db->loadAssocList();foreach ( $data as $d ) {  $options[] = "<option value='{$d->summary}'>{$d->summary}</option>";}

Where do I have to adapt this part in order to fetch the data?Thanks so much for your help,

Martin

ty typomaniac 08 Jul, 2025
Answer
1 Likes

ISSUE SOLVED. I have to use the new Read Data function, which makes it way easier.

Max_admin Max_admin 09 Jul, 2025

Great, thanks for sharing your solution! :)

You can use the Read Data with the "Where Statement" to choose which records to read, and feed that to the Dynamic Options of the Dropdown

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