Make People Picker read only in SharePoint 2010 list form using jQuery

This SharePoint customization tutorial explains, how to make people picker control read only in SharePoint 2010 list form (Edit Form/New Form/ Display form) using jQuery. The below jQuery code is tested in SharePoint 2010 list forms.

Make People Picker read only in SharePoint list form using jQuery

Below is the list form (Edit form) which has a people picker control and it looks like below:

Make People Picker read only in SharePoint list form using jQuery
Make People Picker read only in SharePoint list form using jQuery

Below is the jQuery code to make people picker read-only in SharePoint 2010 list form. Just edit the SharePoint list form and add a script editor web part or content editor web part in the page. Then add the below code inside the script editor web part.

<script language="javascript" src="/JSLibrary/jquery-1.9.0.min.js" type="text/javascript"></script>

<script language="javascript" type="text/javascript">
$(document).ready(function () {
var control = $("textarea[title=’People Picker’]")[0];
/* Detect browser*/
if (navigator.appName == 'Microsoft Internet Explorer’) {
control.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.childNodes[1].style.display = "none";
}
else {control.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.childNodes[2].style.display = "none";
}
var innerHtml = control.parentNode.parentNode.innerHTML;
control.parentNode.style.display = "none";
control.parentNode.parentNode.parentNode.parentNode.parentNode.innerHTML = control.parentNode.parentNode.parentNode.parentNode.parentNode.innerHTML + "<span class='fieldsTitle'>" + $('.ms-inputuserfield #content').text() + "</span>";
});
</script>

Once you save the code and refresh the page, you can see the SharePoint people picker control is disabled in the list form.

make sharepoint people picker read only in list forms using jquery
make sharepoint people picker read only in list forms using jquery

You may like following SharePoint people picker tutorials:

Hope this SharePoint tutorial explains, how to make people picker control read only in SharePoint list forms using jQuery.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

>