Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5980873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:51:48+00:00 2026-05-22T21:51:48+00:00

I want to disable the option that allows users to select the different name

  • 0

I want to disable the option that allows users to select the different name fields(columns) available during a sharepoint library creation. I want the users to create a new column instead of chosing among the default available name columns. Is it possible to inject a script that disables these functions? or any other work arounds?

The document library is created from a custom library template. These name fields should be disabled only for libraries created from this particular template.

enter image description here

This is a Sharepoint 2010 app.

In general how to disable a default column option?

Any help appreciated, Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:51:48+00:00Added an answer on May 22, 2026 at 9:51 pm

    Just in case some one is looking for an answer, am posting this

    The URL is the absolute URL from httpContext

    if (url.Contains(@"/_layouts/ViewEdit.aspx"))
                {
                    sb.AppendLine("Name Field script injection");
                    using (SPSite site = new SPSite(url))
                    {
                        sb.AppendLine("Site URL : " + site.Url);
                        using (SPWeb web = site.OpenWeb("/"))
                        {
                            sb.AppendLine("Web URL : " + web.Url);
    
                                string[] urls = url.Split('/');
    
                                sb.AppendLine("List Name:" + urls[urls.Length - 3]);
    
                                SPDocumentLibrary library = web.Lists[urls[urls.Length - 3]] as SPDocumentLibrary;
                                SPContentType contentType = library.ContentTypes["Document_Content_type"];
    
                                if (contentType != null)
                                {
                                    sb.AppendLine("Content Type Name:" + contentType.Name);
                                    InjectNameColumnScript();
                                    sb.AppendLine("Name Column Script has been injected");
                                }
                        }
                    }  
                }
    

    The script does something like this inside documet.getReady function

    $(document).ready(function() {
       $("#check box_ID").closest("td").parent().attr("style","display:none;");
     });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say you have an app, that you want to provide users ability to browse
I want to disable the selection of certain rows in a datagridview. It must
I want to disable Javascript once a page has already loaded. Why? Because I
I work on a large project and want to disable the Eclipse compiler warning
I have a window (derived from JFrame) and I want to disable the close
I have a menu with an animation going on, but I want to disable
In our embedded system (using a PowerPC processor), we want to disable the processor
I just want to enable or disable the button inside a ControlTemplate for a
i want to be a good developer citizen, pay my taxes , and disable
I have a Login button that I want to be disabled until 3 text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.