Select Page

Yes.. JavaScript SharePoint People Picker… try saying that 3 times fast.

Anyway, I needed one for a form I was developing. It had to be client side, and it needed to work with SharePoint.

In SharePoint 2013, there’s already support for this: http://msdn.microsoft.com/en-us/library/jj713593.aspx

But I need something for SharePoint 2010. I found several articles on manipulating the data in the people picker, but very little on creating a people picker. I continued to google, and my googling bore fruit:

Tanmay Shahane has a neat little bit of code that uses the EntityEditor.js to create a people picker – obviously you should be including jQuery into your page for Tanmay’s script to work. The complete post is here: http://community.zevenseas.com/Blogs/Tanmay/Lists/Posts/Post.aspx?ID=7

But if the link is broken or something, Tanmay’s code as follows:

function EntityEditorHandleCheckNameResult(result, ctx) {
    ULSGjk: ;
    EntityEditorClearWaitCursor(ctx);
    EntityEditorCallback(result, ctx);
    //login name
    var loginName = $(“span.ms-entity-resolved”).attr(“title”);
    //display name
    var displayName = $(“span.ms-entity-resolved div:first-child”).attr(“displaytext”);
//Your custom code can go here for populating rest of the fields in the form calling user profile through client object model
}

Paul Tavares has some interesting widgets for People picking and Uploading that look promising, but I have yet to try them out:

http://paultavares.wordpress.com/2012/04/28/sharepoint-ui-widgets-upload-and-pickusers/