I'm using below code to get user and respective manager details from AD.

$(document).ready(function() {
    var userAccountName= $().SPServices.SPGetCurrentUser();
    //Set current logged in user and manager name in people picker
    //Show the form fields on document.ready()

/****************** All function defintions starts here********************************/
//Function to set people picker values
function LoadPeoplePickerDetails() {
    var url=_spPageContextInfo.webAbsoluteUrl + "/_api/SP.UserProfiles.PeopleManager/GetMyProperties"
        try {
            //Get properties from user profile Json response  
            var userDisplayName = data.d.DisplayName;
            var AccountName = data.d.AccountName;
            $("#tdCurrentUser [id$='upLevelDiv']").html(AccountName);
            $("#tdCurrentUser [id$='checkNames']").click();
            var Manager = data.d.ExtendedManagers.results;
            $("#tdManager [id$='upLevelDiv']").html(Manager[Manager.length-1]);
            $("#tdManager [id$='checkNames']").click();             
        catch(err) {

        //alert("some error occured in getting current User info");

function getReqData(reqUrl,success, failure) {
    url: reqUrl, 
    method: "GET",
    headers: { "Accept": "application/json; odata=verbose" },
    success: function (data) {
    error: function (data) {

1 Answer 1


You'll have to disable the textbox and the icon button, easiest way to do that is in the jquery example in the other stackexchange answer below:

How to make People Picker column Read only in SharePoint 2013

That solution should work for SP Online as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.