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.
-
Hi Devang. how i will get mail id of user.Mayank Surana– Mayank Surana2015-06-04 09:04:58 +00:00Commented Jun 4, 2015 at 9:04
-
spservices.codeplex.com/… check the example there, he shows how to get email from People PickerDevang Zala– Devang Zala2015-06-05 10:30:27 +00:00Commented Jun 5, 2015 at 10:30