- Posts: 10
- Thank you received: 1
TIPP: Disable User Profile Fields for editing
- DMTGMBH
- Topic Author
- Offline
- New Member
-
Less
More
9 years 2 weeks ago #79336
by DMTGMBH
TIPP: Disable User Profile Fields for editing was created by DMTGMBH
If you don't like, that you customers can edit all profile fields after registration, this is the solution for you.
1. Download "com_osmembership/view/profile/tmpl/default.php"
2. Make a copy of it, just for security reasons
3. Open it in an editor of your choice
4. The profile fields are rendered from line 150 - 168
5. After the closing tag "?>" in line 168 add the following lines:
[<]script type="text/javascript"[>]
document.getElementById('XXXXXX').disabled = true;
[<]/script[>]
Remove the brackets "[" and "]" to get it working, otherwise it is not possible to post the code here.
6. Replace the XXXXXX by the id of the input field you like to prevent of editing
7. For example, if you don't like, that your customers can change their company name after registration, replace the 'XXXXXX' with 'organization'. The line should look now like this:
document.getElementById('organization').disabled = true;
8. You can find the id of the input field in the administration section under "Setup > Custom fields", the id is identical with the Name
9. Add for each field, you like to prevent of editing, a separate line with the appropriate id before the closing tag </script>
10. Upload your edited file and replace the existing
11. That's it: In the user profile all fields in the list are now prevented of editing, but the content is visible
12. This script doesn't affect the subscription/registration form, here all fields are editable.
Best regards, Jürgen
1. Download "com_osmembership/view/profile/tmpl/default.php"
2. Make a copy of it, just for security reasons
3. Open it in an editor of your choice
4. The profile fields are rendered from line 150 - 168
5. After the closing tag "?>" in line 168 add the following lines:
[<]script type="text/javascript"[>]
document.getElementById('XXXXXX').disabled = true;
[<]/script[>]
Remove the brackets "[" and "]" to get it working, otherwise it is not possible to post the code here.
6. Replace the XXXXXX by the id of the input field you like to prevent of editing
7. For example, if you don't like, that your customers can change their company name after registration, replace the 'XXXXXX' with 'organization'. The line should look now like this:
document.getElementById('organization').disabled = true;
8. You can find the id of the input field in the administration section under "Setup > Custom fields", the id is identical with the Name
9. Add for each field, you like to prevent of editing, a separate line with the appropriate id before the closing tag </script>
10. Upload your edited file and replace the existing
11. That's it: In the user profile all fields in the list are now prevented of editing, but the content is visible
12. This script doesn't affect the subscription/registration form, here all fields are editable.
Best regards, Jürgen
Please Log in or Create an account to join the conversation.
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.