Filtering users with the pickSPUser widget in SharePoint Forms

Over the last few months I have been using a jQuery plugin by Paul Tavares called SPWidgets. In particular, the pickSPUser and SPControlUpload components have both been quite useful in some SharePoint 2010 forms that I have been developing.

This widget works in a similar way to standard SharePoint people picker control, in that it can sometimes return unwanted suggestions. In my case, we had people from a couple of different domains showing up which weren’t applicable in the context of the form. The pickSPUser component provides a helpful option that enables you to specify a function to filter the suggested people.

The code below initialises the people picker control and filters the user suggestions to the specified AD domain.

Now, if all goes to plan when a user begins to enter a person’s name in the input box it should only provide relevant suggestions.


Leave a Reply

1 Comment

  1. Brilliant. Is there a way to populate more fields like email, accountName..etc?
    Thanks a lot

Next ArticleNew & improved alert emails for SharePoint Online (UPDATED)