After referring this article from Marc,
and Here
am able to get/perform the null check for peoplepicker entries in my custom newform
of my SPList within SP Designer 2010.
But, how to retrieve other attributes, like, if i want to get the email id, display name and other details from this ?
I displayed
> alert( innerSpans[0].innerHTML + ' is 0th index');
Message from webpage
<DIV id=divEntityData style="DISPLAY: none" description="mydomain\p_p"
isresolved="True" displaytext="P P" key="i:0#.w|mydomain\p_">
<DIV data='<ArrayOfDictionaryEntry
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<DictionaryEntry><Key xsi:type="xsd:string">Email</Key><Value
xsi:type="xsd:string">
[email protected]</Value></DictionaryEntry><DictionaryEntry><Key
xsi:type="xsd:string">MobilePhone
</Key>
<Value xsi:type="xsd:string">+91 98 2726 7723</Value>
</DictionaryEntry>
<DictionaryEntry><Key xsi:type="xsd:string">Department</Key>
<Value xsi:type="xsd:string">mfg</Value></DictionaryEntry>
<DictionaryEntry><Key xsi:type="xsd:string">
SIPAddress</Key><Value xsi:type="xsd:string">
[email protected]
</Value></DictionaryEntry><DictionaryEntry>
<Key xsi:type="xsd:string">
Title</Key><Value xsi:type="xsd:string"/></DictionaryEntry>
</ArrayOfDictionaryEntry>'></DIV></DIV>
and i got above details, but I am stuck with how to extract those
DictionaryEntry from DictionaryEntryArray.
How to iterate through the array of DictionaryEntryArray items.
function getPickerInputElement(identifier)
{
alert(' inside getPickerInputElement ');
alert(identifier);
var tags = document.getElementsByTagName('DIV');
for (var i=0; i < tags.length; i++) {
var tempString = tags[i].id;
//alert('tags[' + i + '].id = ' + tempString);
if ((tempString.indexOf(identifier) > 0) &&
(tempString.indexOf('UserField_upLevelDiv') > 0)){
//alert('HIT for ' + identifier + ' id=' + tags[i].id + ' value=' +
tags[i].value);
var innerSpans = tags[i].getElementsByTagName("SPAN");
for(var j=0; j < innerSpans.length; j++) {
//alert('innerSpans[' + j + '].id = ' + innerSpans[j].id);
if(innerSpans[j].id == 'content')
{
//alert('HIT for ' + identifier + ' id=' + innerSpans[j].id + '
innerHTML=' + innerSpans[j].innerHTML);
alert( innerSpans[0].innerHTML + ' is 0th index');
return innerSpans[j].innerHTML;
} } } }
return null; }
</script>
i tried to get the value below:
var pp2 = $().SPServices.SPFindPeoplePicker({ peoplePickerDisplayName:
whatDisplayName }).row.find("div[id='divEntityData']")
.attr("displaytext");
so i got the correct value of displayname. But similarly, how to get the other attributes?