[solved]placeholder in dropdown advanced calculation

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:

$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;​

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
 
When you do:

$comprog = '{beneficiaries___programme}';
var_dump($comprog);
exit;

you get empty string?

What about:

$comprog = $data['beneficiaries___programme'];
var_dump($comprog);
exit;
 
Hello juser

Thanks for the tips - or for asking the right questions.
I realized that I can't use a dropdown element either because the $comprog is defined via a radiobutton element. And the dropdown element has no ajax watch feature.

So this problem is solved. Remains the one how to get the LEFT JOIN into the cascading dropdown....

Thanks to all!
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top