Hi ,
To fetch People picker value from People Editor Control, JQuery comes to rescue when we talk in terms of Javascript Client Object Model.
Approach 1 :
var loginName = $("span.ms-entity-resolved").attr("title"); // Returns the Login Name eg. ind\ali.yasir
var displayName = $("span.ms-entity-resolved div:first-child").attr("displaytext"); Returns Display Name as 'Ali Yasir'
Approach 2:
var loginName = $("textarea[title='People Picker']").val();
var displayName = $("div[title='People Picker']").text();
Hope this will help !!
To fetch People picker value from People Editor Control, JQuery comes to rescue when we talk in terms of Javascript Client Object Model.
Approach 1 :
var loginName = $("span.ms-entity-resolved").attr("title"); // Returns the Login Name eg. ind\ali.yasir
var displayName = $("span.ms-entity-resolved div:first-child").attr("displaytext"); Returns Display Name as 'Ali Yasir'
Approach 2:
var loginName = $("textarea[title='People Picker']").val();
var displayName = $("div[title='People Picker']").text();
Hope this will help !!
how about multiple people pickter controls on the form
ReplyDelete