Hide Save button in New and Edit form in SharePoint 2013 list

Hide Save button in New and Edit form in SharePoint 2013 list

In this post, we will discuss how to hide the save button from the ribbon in SharePoint 2013 list form using JavaScript and css.

Before to that, you can check out some posts on:
Add attachment field to Post list in SharePoint 2013 blog site

SharePoint deveopment training course

Working with Chart Web Part in SharePoint 2013 or SharePoint 2010

Unable to send Email Alias in a SharePoint Online Workflow Send Email Action

We have a SharePoint list where we have customized the input form using InfoPath. And in that customized InfoPath form we have a custom Save button and we are saving the item from the default data connection. This button also has some validation rules.

So we do not want any user to insert an item by clicking on the Ribbon Save button. They should only be able to save through our Submit button which was presented inside the InfoPath form.

You can disable the Save button from the InfoPath form submit properties. But we do not want to show the Save button at all. Be default the submit button appears like below:

Hide Save button in New and Edit form in SharePoint 2013 list
Hide Save button in New and Edit form in SharePoint 2013 list

We have written the JavaScript and css code to hide the Save button. For this Edit the page and then Insert a Script editor web part into it. Then write the below code inside the script editor web part and Save the page.

<script type=”text/javascript”>
function hideEdit() {
var edit = document.getElementById(“Ribbon.ListForm.Edit.Commit.Publish-Large”);
edit.style.display = “none”;
}
_spBodyOnLoadFunctionNames.push(“hideEdit”);
</script>

Once you will Save the Save button will be hidden as shown in the fig below:

Hide Save button in New and Edit form in SharePoint 2013 list
Hide Save button in New and Edit form in SharePoint 2013 list
Check out Best Alternative to InfoPath -> Try Now

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →