Monday 4 April 2016

Remove hyperlink from lookup/people picker column of Sharepoint list display form


Add below lines of code in your default display form using CEWP, it will remove the hyperlinks from the columns like lookup, people picker

<script src="/sites/SiteName/SiteAssets/jquery-1.8.3.min.js"></script><script language="javascript">

// For muti user column
$("td.ms-formbody[id$='SPFieldUserMulti'] a").each(function (i,n) { $(n).replaceWith("" + $(n).text() + ""); });

// People Picker Column
$("td.ms-formbody[id$='SPFieldUser'] a").each(function (i,n) { $(n).replaceWith("" + $(n).text() + ""); });

// Lookup Column
$("td.ms-formbody[id$='SPFieldLookup'] a").each(function (i,n) { $(n).replaceWith("" + $(n).text() + ""); });
</script>

No comments:

Post a Comment