0

I need to get the value of the PeopleEditor using JavaScript and jQuery. following this article :

http://www.andrewconnell.com/blog/Using-JavaScript-jQuery-to-get-the-value-of-the-PeopleEditor-in-SP2013

I did exactly the same but i allways get the undefined value :

this is the html code :

<SharePoint:PeopleEditor AllowEmpty="true" ID="docReviewerUser"                            
            runat="server" MultiSelect="false" SelectionSet="User" Width="300px" /> 

and this is the JavaScript :

 var html = $("#ctl00_PlaceHolderMain_docReviewerUser_upLevelDiv");
 var DocReviewerLoginName = $("#divEntityData", html).attr("key");

DocReviewerLoginName = undefined .

1 Answer 1

0

Using browser developer tool make sure the Id of the control is ctl00_PlaceHolderMain_docReviewerUser_upLevelDiv

Another option is to use the id contains selector, which is not recommended

var html = $("[id*=docReviewerUser]");
var DocReviewerLoginName = $("#divEntityData", html).attr("key");
1
  • I sill get the same error after using $("[id*=docReviewerUser]");
    – user39792
    Feb 19, 2015 at 10:00

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.