How to Showing ID value in SharePoint 2010


if you need to showing ID column when you open the edit list item so you can use this script below :

<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>

Komentar

Postingan populer dari blog ini

You cannot view a list in Datasheet view on a SharePoint

CAML query with nested AND's and OR's for multiple fields in SharePoint

Synchronizing an Excel file with SharePoint