Dropdown option visibility depending on Joomla user access group

Control dropdown option visibility based on Joomla user access group.

Overview

The issue is that dropdown elements in CF do not natively filter options by user group.
Create separate dropdown elements for each user group, then use the {user:groups} variable and element events to show or hide the appropriate dropdown based on the logged-in user's access level.

Answered
ChronoForms v6
st stojsins 17 Apr, 2020
Hello everybody.

I'm trying to set dropdown option visibility depending on Joomla user access group.
So, if my user who is logged on website is a member of Super Users user group, he should be able to see all available option in dropdown element.
If the user is member of Author user group, he should be able to see only some of the options in dropdown element.

I have managed to pull Joomla user access group ID using {user:groups}, but I can not go further...
If I try to add HTML code in dropdown option, nothing happens...

Any ideas?

Is there any way I can setup some ID {user:groups} or class {user:groups} on dropdown option, and then using CSS hide some options for some Joomla user access group ID's?
Gr GreyHead 18 Apr, 2020
Hi stojsins,

The CFv6 manual says that you can add a variable from the form data into the Options box e.g. {var:read_data27}. This is talking about loading data from a database table. I think you could equally do that from array of key/value pairs built in a custom code section.

Or if there are just two lists you could add two dropdown elements to your form and hide+disable one of them using CSS.

Bob

Bob
st stojsins 18 Apr, 2020
Answer
Hi Bob.
Than you for answer.

I managed to pull Joomla user access group ID using {user:groups}, create three dropdows with different options, and depending on logged user (Joomla user access group ID), using events option on elements, control visibility for each Joomla user access group ID.
This topic is locked and no more replies can be posted.