Showing the records ID on the View and Edit forms in sharepoint

– Go to the List
– Add /DispForm.aspx?ToolPaneView=2 to the URL
This will open the page in editable form and the add a content editor webpart. Edit it to add the HTML content.
– Add for example a ContentEditorWebPart and paste in the script below;
You can do the same thing with EditForm aswell.

<script type="text/javascript"
</script>
<script type="text/javascript">
 
$(function() {
  // Get the ID from the query string
  var id = getQueryString()["ID"];
 
  // Find the form's main table
  var table = $('table.ms-formtable');
 
  // Add a row with the ID in
  table.prepend("<tr><td class='ms-formlabel'><h3 class='ms-standardheader'>ID</h3></td>" +
                "<td class='ms-formbody'>" + id + "&nbsp;</td></tr>");
})
 
function getQueryString() {
  var assoc = new Array();
  var queryString = unescape(location.search.substring(1));
  var keyValues = queryString.split('&');
  for (var i in keyValues) {
    var key = keyValues[i].split('=');
    assoc[key[0]] = key[1];
    }
  return assoc;
}
</script>




Comments

  1. Most people works to you being person in we, and may likewise can help you go to the homework workplaces around Stockholm � finding cash for ones solution and even hotel, once we carry out assume that a gathering directly allows you to observe how considerable we have been within making a superb functioning connection. https://imgur.com/a/rn9tNGl https://imgur.com/a/P7huFa9 https://imgur.com/a/98yFFwB https://imgur.com/a/XspdZT8 https://imgur.com/a/dakv0SA https://imgur.com/a/XgYxOIK https://imgur.com/a/FhP0OKS

    ReplyDelete

Post a Comment

Popular posts from this blog

SharePoint 2016 and 2019 Ports

PsConfig step by step /Configuration Wizard. “Upgrade Available” vs “Upgrade required”

Unlock the SharePoint site using Powershell command