I am trying to:
To set a credform tot readonly for logging in users.
When a user with the role 'werkgever' is logged in the available forms most be read only. They ca only be edited by administrators. I can't find that in acces en when I set the CRED fields to read only I cannot set the radiobuttons tot readonly.
Link to a page where the issue can be seen:
I expected to see:
Instead, I got:
Hi, the "readonly" attribute only works on text-based input fields, not checkboxes or radios. You can find that information in our documentation here:
https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_field
When a user with the role 'werkgever' is logged in the available forms most be read only.
There's not an easy way to do this with CRED, because the readonly attribute does not apply to all kinds of fields. Instead, you could use Access to hide the entire CRED form and show something else in its place. For instance, you could show a View that displays the post and custom field information in text format. If you want to format that information to look like a read-only form, it will require custom code.
Hi Christian,
Thanks for your reply!!
Is are very big forms with a lot of data. Is there a way to make a view with all the data at once?
Is there a way to show the forms tot a user with the role 'werkgever' where his edits don't save (not editable)
Is there a way to quick make a layout for the view. I use Bever Themes but I can use Layouts from types.
Jacques
Is there a way to make a view with all the data at once?
There is no feature to automatically create a View with all the data fields in place. If you want to mimic the CRED form design, you can create another Edit CRED form and replace the cred_field shortcodes with custom field shortcodes. This is probably the fastest way to create a similar design. Then you can use Access Controls to show this modified form to "werkgever" Users, and show the regular Edit CRED form to other Users.
Is there a way to show the forms tot a user with the role 'werkgever' where his edits don't save (not editable)
You could use inline Access Controls to wrap the "submit" button in a conditional that hides the button from all "werkgever" users. This is not foolproof, so you should add some backend validation enforcement using the cred_form_validate API:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate
Is there a way to quick make a layout for the view. I use Bever Themes but I can use Layouts from types.
There is no quick way to create a Layout that includes all the information you would find in a CRED form. Each field must be added to a View or Visual Editor cell to appear in the Layout.