I have written the below code for getting the display name from the PeoplePicker field on PreSaveAction() call in my custom list form in SP 2010.
I got the displaytetx attr: mydomain\name2 Now using this display name, how to get the email id, department etc from user profile? Something like, i can pass this as a param to some other API - CSOM / JSOM /SPServices which extracts the email id
<script language="javascript" src="/project/AssetsLib/jquery-
1.6.0.min.js"
type="text/javascript"></script>
<script language="javascript"
src="/project/AssetsLib/SPUtility.js" type="text/javascript">
</script>
<script language="javascript"
src="/project/AssetsLib/jquery.SPServices-2014.01.min.js"
type="text/javascript">
</script>
<script language="javascript" type="text/javascript">
// This function from SPServices gets all of the Query String
//parameters
var myuserid = _spPageContextInfo.userId;
var queryStringVals = $().SPServices.SPGetQueryString();
var whatDisplayName ="Reporting Manager Name";
var pp2 = $().SPServices.SPFindPeoplePicker({
peoplePickerDisplayName:
whatDisplayName }).row.find("div[id='divEntityData']")
.attr("displaytext");
alert( 'the pp title ...' + pp);