Take the 2-minute tour ×

Think of this scenario,
If I add two user entries to people picker(multiple selection is permitted) field.
I need to count these entries using java script/Jquery(Output what i want is: 2).
how can I do this.
I tried to get the value of that field using Jquery it's giving hell out of things.
This is what i tried:

 $("#DivId").focusout(function () {
share|improve this question

2 Answers 2

Update: The people picker will create a span element for each user, you should be able to use this code (using jQuery):


If you have several pickers you should be able to split them, for example by [name*=UserFieldValue] like this:

  var count = $(this).next().find('.ms-entity-resolved').length;
share|improve this answer
Thank You @eirikb .. I am using 2010 version.. I will check this code –  Praveen M P Feb 24 at 7:03

EntityEditor.js contains method GetPickerControlValue for getting picker control value(s). (by default ';' delimiter is used for multiple values)

The following code demonstrates how to get the number of control values in Picker Control:

var pickerControlVals = GetPickerControlValue(currentEntityEditorContextId, true, true);

var numOfUsers = pickerControlVals.split(';').length - 1;

Variable currentEntityEditorContextId corresponds to Picker Control Id and available on the page where Picker Control is rendered

share|improve this answer

Your Answer


