I have a form which contains 3 client side people pickers, i use the following JS to produce the People Pickers
// Render and initialize the client-side People Picker
function initializePeoplePicker(peoplePickerElementId) {
// Create a schema to store picker properties, and set the properties.
var schema = {};
schema['PrincipalAccountType'] = 'User,DL,SecGroup,SPGroup';
schema['SearchPrincipalSource'] = 15;
schema['ResolvePrincipalSource'] = 15;
schema['AllowMultipleValues'] = true;
schema['MaximumEntitySuggestions'] = 50;
schema['Width'] = '300px';
// Render and initialize the picker.
// Pass the ID of the DOM element that contains the picker, an array of initial
// PickerEntity objects to set the picker value, and a schema that defines
// picker properties.
this.SPClientPeoplePicker_InitStandaloneControlWrapper(peoplePickerElementId, null, schema);
}
Then to initialise the People Pickers themselves i use:
initializePeoplePicker('peoplePickerDiv');
initializePeoplePicker('managerPickerDiv');
initializePeoplePicker('mdPickerDiv');
and on the front end itself.
<div id="peoplePickerDiv" class="peoplepicker"></div>
<div id="managerPickerDiv" class="peoplepicker"></div>
<div id="mdPickerDiv" class="peoplepicker"></div>
This all works. What i want to do for each pp is capture the ID and Name of the person and store them in a list. I know how to store them in a list, just need to know how to get the ID and Name from PP?
OK I can now get the Name from the People pickers...but still no way to get the ID which I need so i can populate the person or group type Column.