This project has moved and is read-only. For the latest updates, please go here.

How to trigger a call to another function when a user fills the PeoplePicker

Aug 7, 2013 at 12:44 AM
Edited Aug 7, 2013 at 12:46 AM
Marc asked to move the question out here so here it is:

How would you go about running “$().SPServices.SPFindPeoplePicker” whenever a user finishes selecting a user?

Is it as simple as:

$(document).ready(function() {
var supervisor = $().SPFindPeoplePicker({
  peoplePickerDisplayName: "Requesting Supervisor"
function Checksupervisor(){
  var supervisor = $().SPFindPeoplePicker({ peoplePickerDisplayName: "Requesting Supervisor"}); 
  var current = supervisor.currentValue;

Thanks in advance.
Aug 7, 2013 at 3:15 PM
It's not quite that simple because the name must be resolved. Can you explain a bit more about what you want to do with the value?

Aug 7, 2013 at 6:25 PM

I want to user the user ID to call userprofileService.asmx and get other information

Aug 7, 2013 at 7:17 PM
Yes, but do you need to do that as the user adds people or groups (if the user is allowed to add multiple people the logic would be different) or can it happen when the item is submitted?

Aug 11, 2013 at 7:54 PM
the business value could be the following scenario:
A user picks another user with the people picker
the event uses the selected user's ID to lookup Department location and other information about the selected user in userprofileService.asmx and show it right away by populating the innerHTML of some existing input boxes or a div. (or use knockout.js for binding the results)
My scenario is for picking just one user and not a group. And I am not sure what you refer to as ""item is submitted"
I am looking for some kind of AJAX like client side only UX.

I understand that the return type of .SPFindPeoplePicker() is complex and I will have to figure out the Jason when it comes back. but I need to understand where to write the code in order to trap the event o the end of the selection by the user.

Thanks in advance