Skip to content
Amal Hashim
All posts
Snippet

SharePoint 2013 - Directly open list item edit form

Use jQuery in a Script Editor web part to make list item links open the edit form instead of the display form.

1 min read#SharePoint#SharePoint 2013#jQuery

Editing a list item takes extra clicks. You open the context menu and choose Edit Item, or you open the item in view mode and then click Edit Item.

With jQuery you can change the links so they open the edit form directly. Add a Script Editor web part to the list view page and paste this code:

html
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
  // Change all display form links to edit form links
  $('.ms-vb a[href*="listform.aspx"]').each(function(){
      var url = $(this).attr('href');
      url = url.replace("PageType=4", "PageType=6");
      $(this).attr('href', url);
  });
});
</script>

PageType=4 is the display form and PageType=6 is the edit form, so the replacement points each link at the edit form.