JavaScript SharePoint People Picker

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:

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:

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

function EntityEditorHandleCheckNameResult(result, ctx) {
    ULSGjk: ;
    EntityEditorCallback(result, ctx);
    //login name
    var loginName = $(“”).attr(“title”);
    //display name
    var displayName = $(“ 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: