Staying at list item interface after editing

Mr Busy 41 Reputation points
2023-02-05T10:02:45.2633333+00:00

Hello everyone,

We are using Sharepoint server 2019 (on premise).

We would like to stay at list item's interface after editing it (and pressing OK to save). Is there any setting to enable that or any workaround to do?

In current way, Sharepoint will close item view and switch to list view.

Thanks for any idea.

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,298 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,300 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AllenXu-MSFT 18,441 Reputation points Microsoft Vendor
    2023-02-06T02:59:28.9066667+00:00

    Hi @Mr Busy,

    Add the following JavaScript code into a Script Editor web part in Edit list item form page(http://xx/Lists/xx/EditForm.aspx).

    <script src="http://code.jquery.com/jquery-3.1.0.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function(){	 
    	var button = $("input[id$='SaveItem']");	 
    	button.removeAttr("onclick");
            button.val("Apply");
    	button.click(function() {
    		var elementName = $(this).attr("name");
    		var aspForm = $("form[id='aspnetForm']");
    		var oldPostbackUrl = aspForm.get(0).action;
    		var currentSourceValue = GetUrlKeyValue("Source", true, oldPostbackUrl);
    		var newPostbackUrl = oldPostbackUrl.replace(currentSourceValue, encodeURIComponent(window.location.href));
     
    		if (!PreSaveItem()) return false;
    		WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(elementName, "", true, "", newPostbackUrl, false, true));
    	});
    });
    </script>
    
    

    EditForm


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.