0

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.

1

2 Answers 2

1

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.

0

SPUtility.js is free javascript library which does this very well.

Example

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.

2
  • Hi Devang. how i will get mail id of user. Commented Jun 4, 2015 at 9:04
  • spservices.codeplex.com/… check the example there, he shows how to get email from People Picker Commented Jun 5, 2015 at 10:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.