The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December. Read our blog post for more info about this change.
Ok, I've scoured through the discussions, Canvas guides, and random Google searches ... I'm looking for any assistance someone with way better JavaScript skills than me can provide.
Does anyone have a custom script that will allow me to hide an option on the profile edit page for students? I'm trying to allow them to only change their display name, but not the full name that is assigned via the SIS.
I know that there is a Feature Idea in product radar stage about this specifically, but I was just wondering if anyone had a work around right now.
Thanks for any help you can provide,
Anna
Solved! Go to Solution.
We were able to allow our students to change their Display Name without allowing them to change their full name or sortable name by adding the following two lines to the universal javascript code in the theme editor:
document.getElementById('user_sortable_name').readOnly = true;
document.getElementById('user_name').readOnly = true;
These two lines gray out the full name and sortable name options. To enable them to edit the Display Name field, you still have to set the option to allow students to edit their names in the Admin Settings.
@MSJC-DELTA , due to the technical nature of this question I’m going to share it with the Canvas Developers group in the Community to see if they can help. It’s seems like this would require some custom global JavaScript, but that’s well beyond my area of expertise! You might consider joining this group so you can have access to their resources and information.
Hope this helps!
Kona
Thanks for the assist @kona hopefully a JavaScript wiz out there will come to my rescue. ![]()
~Anna
Anna,
I don't have any great answers except to say; I wish there were an option to allow people to change just their display name.
Having said that I do have a possible work around. Our school uses PeopleSoft as our SIS and it also has some soft of preferred name field. I don't the rules in PeopleSoft about who gets to update that field or how, but we use it to populate the Display name in Canvas through our SIS uploads. So presumably a student (or teacher) can update the name in our SIS and it propagates to Canvas via our SIS nightly feeds.
Rick
We were able to allow our students to change their Display Name without allowing them to change their full name or sortable name by adding the following two lines to the universal javascript code in the theme editor:
document.getElementById('user_sortable_name').readOnly = true;
document.getElementById('user_name').readOnly = true;
These two lines gray out the full name and sortable name options. To enable them to edit the Display Name field, you still have to set the option to allow students to edit their names in the Admin Settings.
I just tested this in our environment and it works as expected. Only Display Name is editable.
Thank you for sharing this! We are a smaller school and had a request come up for a student who wanted to change their display name only - these two lines of code worked perfectly. Just copied and pasted them into our JS file which we have a few lines of code in already due to a configuration with Watermark and saved/uploaded. Then changed the setting to let them edit their name. Masqueraded as that student to confirm and its perfect! Love the elegance of this solution! Thank you so much for sharing this on the community for others!
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.