I want to compare text of 2 people picker which are on same form.how to do it using JavaScript or Jquery. I have already gone through so many blogs but they are not providing the exact solution that i want.
2 Answers
You can use a Sharepoint function to do it that is called GetPickerControlValue
. You'll need to known the HTML ID of the both fields. Then just use GetPickerControlValue("ID_of_the_UserField", false, false)
to get the value.
SPUtility.js is free javascript library which does this very well.
You need to add the js reference in your master page.
// Get the field
var peopleField = SPUtility.GetSPField('Assigned To');
//here "assigned to" is field name
spservices.js also supports this. Example
var salesRep = $().SPFindPeoplePicker({
peoplePickerDisplayName: "Column Display Name"
});
Let me know if you need more help.
-
-
spservices.codeplex.com/… check the example there, he shows how to get email from People Picker Commented Jun 5, 2015 at 10:30