There is a module that does this I think. User Read Only or something like that. I can't seem to find it right now, but if you look in the modules page, you should find it.
newms
I need something similar. I have 3 profile list fields with numeric values attached. I want a 4th profile value (not numeric and will be a list of 7 or more choices) that is determined by a series of calculations of the first 3 values. The 4th profile will be read only or hidden so that it can only be changed by selecting different values for the the first 3 profiles. Is the hook_profile_alter what I'm looking for, or is there a series of modules that can accomplish this?
Thanks for your help. I did what you suggested and added a snippet that calculates the 4th profile value in the profile_save_profile function and it works great.
Comments
There is a module that does
There is a module that does this I think. User Read Only or something like that. I can't seem to find it right now, but if you look in the modules page, you should find it.
newms
Profile module
If you are creating profile fields with the profile module its just a check box under the visibility.
* Hidden profile field, only accessible by administrators, modules and themes.
This also means the user can't see it so it might be too read only for what you need.
If you wanted it to be viewable you would probably have to do this in the code by making the form item disabled. In that case you'd need a custom module and want to look at hook_profile_alter http://api.drupal.org/api/HEAD/function/hook_profile_alter and/or hook_form_alter http://api.drupal.org/api/HEAD/function/hook_form_alter to change the profile view and/or edit form.
dLd
I want to keep this field
I want to keep this field visible to use but read only.
Sharique Ahmed Farooqui
Here's the link to the
Here's the link to the module I mentioned before:
http://drupal.org/project/user_readonly
newms
This module does exactly what
This module does exactly what the OP (and I) wanted!
Calculated Profile Value
I need something similar. I have 3 profile list fields with numeric values attached. I want a 4th profile value (not numeric and will be a list of 7 or more choices) that is determined by a series of calculations of the first 3 values. The 4th profile will be read only or hidden so that it can only be changed by selecting different values for the the first 3 profiles. Is the hook_profile_alter what I'm looking for, or is there a series of modules that can accomplish this?
You probably want to hook
You probably want to hook into the profile form validation and set the values of your hidden fields there.
dLd
Thanks for your help. I did
Thanks for your help. I did what you suggested and added a snippet that calculates the 4th profile value in the profile_save_profile function and it works great.