0

I am looking for code to access the people picker field values using JSOM (ECMA Script) in SP 2010. I know it's possible using C#,

      if(pplpickerManager.ResolvedEntities.Count > 0)
      {
      PickerEntity manager = ppManager.ResolvedEntities(0) as  PickerEntity) 
 ....
      }

but, how to achieve the same in ECMA script

Though I tried to get the solution using SPServices with the below code, I am unable to get the multi people field values.(I mean, the picker field accepts multiple people value names (not single value)).

   var picker = $().SPServices.SPFindPeoplePicker({
   peoplePickerDisplayName: whatDisplayName 
     });

   var data = picker.row.find("div[id='divEntityData'] div").attr("data");
   var xml = $(data);//accepting data by jQuery
   var data = xml.find('Key:contains("MobilePhone")').next().text();
   console.log(data);//data contains mobile phone now 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.