lori19
Active Member
Hi there
I'm kin of reopening https://fabrikar.com/forums/index.p...base-join-element-is-not-working.52528/page-2
Here's my case:
I have a form where one field should indicate the responsible staff depending on the programme: All staff are assigned to a programme at registration, I use the joomla custom fields feature to do this.
Now I want to filter the user's list according to the programme that is selected at the beginning of the form.
For this, I set up a dropdown element where the options are set in the advance section like this:
The feature works well when I put the where clause in clear text, e.g. "Programme A". However, when I use a placeholder, $comprog turns out empty.
I tried to use a database join element or a cascading dropdown element but it seems they cannot handle the join with the #_fields table.
Any hints on what to try next?
Thanks a lot!
Lorenz
I'm kin of reopening https://fabrikar.com/forums/index.p...base-join-element-is-not-working.52528/page-2
Here's my case:
I have a form where one field should indicate the responsible staff depending on the programme: All staff are assigned to a programme at registration, I use the joomla custom fields feature to do this.
Now I want to filter the user's list according to the programme that is selected at the beginning of the form.
For this, I set up a dropdown element where the options are set in the advance section like this:
$comprog = '{beneficiaries___programme}';
$query = 'SELECT t1.id,t1.name FROM al7s2_users as t1 LEFT JOIN al7s2_fields_values as t2 on t1.id = t2.item_id WHERE t2.value = "'.$comprog.'" ORDER BY t1.name ASC';
$db = JFactory::getDbo();
$db->setQuery($query);
$rows = $db->loadObjectList();
foreach ($rows as $row) {
$options[] = JHTML::_('select.option', $row->name, $row->name);
}
return $options;
$query = 'SELECT t1.id,t1.name FROM al7s2_users as t1 LEFT JOIN al7s2_fields_values as t2 on t1.id = t2.item_id WHERE t2.value = "'.$comprog.'" ORDER BY t1.name ASC';
$db = JFactory::getDbo();
$db->setQuery($query);
$rows = $db->loadObjectList();
foreach ($rows as $row) {
$options[] = JHTML::_('select.option', $row->name, $row->name);
}
return $options;
The feature works well when I put the where clause in clear text, e.g. "Programme A". However, when I use a placeholder, $comprog turns out empty.
I tried to use a database join element or a cascading dropdown element but it seems they cannot handle the join with the #_fields table.
Any hints on what to try next?
Thanks a lot!
Lorenz