I've created a content type that contains a form. In this form, there is a textfield that i want to make only readable + a specific value on it (if user A is editing this form, he can write on all textfields except this textfield that will contains : user A)

In the other side, I've a custom module that deals with users, so I have users with users ID, usernames..ect the username is the text that I want to automatically set on the content types textfield

I can't show you any code because as I said, it's a content type

Any help is great


It sounds like you're looking for Field Permissions.

The Field Permissions module allows site administrators to set field-level permissions to edit, view and create fields on any entity.

| improve this answer | |
  • This module can make a textfield only readable ? – Mitch Jul 6 '15 at 8:51
  • Yes. Do not grant the "Edit" or "Create" permission for the field (only the "View" permission). – Free Radical Jul 6 '15 at 9:06

If this field is only used by modules and its existence doesn't make any change in your user's life , then you can make this field hidden in form . you also can fill its data using rules easily .

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.