unhide group depending on Joomla access level

relsig

Member
I have a form (see attachment). The group in red should be hidden if the user is not logged in. I tried to set the access levels according to that, but this made that there was no default value for the fields anymore. Therefore I hid the group and the form works perfect.

The administrator has to be able to change the value of the dropbox "status". How can I unhide the group if somebody with the corresponding Joomla access rights is logged in?

I know that I can hide the group if there are no elements. This would lead me to hiding/showing the top three elements. I tried to use the java script for the show/hide, but no luck.

Can you give me a hint on how to do that.

Thanks
 

Attachments

  • hide group.JPG
    hide group.JPG
    73.7 KB · Views: 327
Set group to "hide, if no usable elements"
Set elements access levels (form and details view) to registered/admin (whatever your access levels are)
 
thanks for your reply. If I set the access levels like you describe, then the values are not saved into the database. I have two values, the status und the date/time when the recordset is created. Setting access levels to those two leaves them empty (the default values are not written to the database) when a regular user fills out the form.
Because of that I set the elements to hide for the regular user. But the admin should be able to see the fields. This is my problem.
For now I set the fields to read only for the regular user. Doesn't look good though.
Is there another way to do that?
 
Are you running a recent Fabrik version?
Default values are saved on my site without user access.
 
I'm running 3.0.9 under the latest Joomla 2.5 version.
the values are saved ok if I use hidden values.For the regular users this would be fine. But the logged in users have to change the status (see elements.jpg). setting the elements to hidden will keep them always hidden. No matter who is logged in.

If I set the access level to that element to special or registered then I think the element is simply not present when a regular user fills out the form. Therefore there is no value to save to the database.
I do the following: I have a date/time field which automatically sets the actual time. (settings.jpg).
For now I have set it as shown in settings. this makes my form work fine (all values are saved) but makes me shown internal information to non registered users.

Is it clearer now?
 

Attachments

  • settings.jpg
    settings.jpg
    48.8 KB · Views: 264
  • elements.JPG
    elements.JPG
    22.8 KB · Views: 267
It's working on my site:
field and date default values are stored in DB, elements not hidden, no access/display to normal users, access for logged in users (element form and details view access = registered);
group access PUBLIC, hide if no usable elements
 
Back
Top