Hide a Save button at List Ribbon in SharePoint via CSS or JavaScript

In this hint, I need to hide / disable a save button within the list ribbon in SharePoint 2013 via CSS or JavaScript

Hide save option at ribbon in sharepoint listTo be like this

Hide save Button ribbon in sharepoint listSteps :

Disable the list forms to be not showing as dialog via

  • List Settings.

List Settings

  • Advanced Settings.

List Settings - advanced settings

  • Dialogs > Select No.

Launch forms in dialog

  • Go back to All items page > Click on the new item.
  • Pick up the Ribbon button ID by clicking on F12.
  • Select the button ribbon that you need to hide , In my case, it’s the save button.

F12 Dom Explorer

  • Double click on ID > Right Click on Select Copy to copy the Button ID.

Copy ID from F12 Dom Explorer

  • From Site Settings > Edit Page.
  • Click on Add web Part > From Media and Content > Add Script Editor.

Script Editor

  • Edit Snippet.

Edit Snippet

Here, you have two options to hide a button ribbon in SharePoint List.

  • Via CSS.

<style>
#Ribbon\.ListForm\.Edit\.Commit\.Publish-Large
{ display:none !important; }
</style>

Hide Button ribbon in sharepoint list via CSS

  • Via JavaScript.


document.getElementById("Ribbon.ListForm.Edit.Commit.Publish-Large").style.display="none";

Hide Button ribbon in sharepoint list via javascript

Note : The previous steps can be applied to a specific list,

If you need to apply it for all lists in a specific site, you should follow the mentioned steps below :

  • Make sure that you have a full control access on the site.
  • Create a CSS file with the above CSS.
  • Upload it to the Site Assets or Style library of the site,
  • Go to Site Settings > Master Page > Alternate CSS URL.

Master Page - look and feel

  • Check the third option > Click Browse and select the CSS file that has been uploaded earlier in the Site Assets library.

Alternate CSS URL

  • Click OK.

If you need to apply it for all lists in a Site collection, you should follow the above-mentioned steps but at the root site, you will also need to be a site collection administrator.

Enjoy 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s