Forums

dynamic dropdown list with a condition

ChDUP 15 May, 2014
Hi.

I'm using ChronoForm 5.
I would like to display in a dropdown list all my content included in a specific category.
For the moment, with the action "DB read", my select shows all my content (id and title) in table joomla_content.
I would like to add a condition "WHERE catid = xx" to the SQL request.

How to do this ?
Thanks for your help.
GreyHead 15 May, 2014
Hi ChDUP,

Use the Conditions box in the DB Read action. You will need a condition like:
<?php
return array('catid' => 'xx');
?>

Bob
ChDUP 15 May, 2014
Thanks GreyHead.
But I've already tried, and it just write
< ?php
return array('catid' => 31);
?>
in the front office, above the front.
And my dropdown isn't affected.
I've tried with and without the "<?php ... ?>" code.
I don't understand how conditions works.
GreyHead 15 May, 2014
Answer
Hi ChDUP,

It needs to be in the Conditions box as I said.

I'm sorry, there was a typo in my code, an extra space in <?php :-(

Bob
ChDUP 16 May, 2014
Oh, no it's my fault, I haven't see the space too.
I made the same mistake in my first try, for sure.
It's because there's an extra space in the admin, in the sample, just bottom the conditions box.
So, copy-past are wrongs !

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